Is there any way to get the setup path of the excel.exe by programming?


#1

I want to get the setup path of the excel.exe and the fileformattype of the Excel file by programming?
I want to use the Excel.Open ( System.String fileName , Aspose.Excel.FileFormatType type )to open an excel file, but now I can not sure the excel fileformattype, maybe it’s excel2000 or excel2003. How I can do this automatically?


#2

If you don’t know the version of your Excel file, just set format as FileFormatType.Default.


#3

I use :
System.Diagnostics.ProcessStartInfo startInfo;
System.Diagnostics.Process process;
this.startInfo=new System.Diagnostics.ProcessStartInfo(@“C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe”,initFilePath);
this.startInfo.WindowStyle=System.Diagnostics.ProcessWindowStyle.Minimized;
this.process.StartInfo=this.startInfo;
this.process.Start();
to open the excel file automatically, but if the office2003 does not install at C:\Program Files\Microsoft Office, or use the office2000, then I can not open the excel file. I mean is there anyway to get the path"C:\Program Files\Microsoft Office\OFFICE11\EXCEL.exe" by programming?
I can use the Application.startupPath() to get the path of curren running application ,but before I run Excel.exe how I can get its setup path?
Thank you!Yes


#4

Please try:


System.Diagnostics.ProcessStartInfo startInfo;
System.Diagnostics.Process process = new System.Diagnostics.Process();
startInfo=new System.Diagnostics.ProcessStartInfo("Excel.exe", "d:\\book1.xls");
startInfo.WindowStyle=System.Diagnostics.ProcessWindowStyle.Minimized;
process.StartInfo= startInfo;
process.Start();