Hello
I am developing a program that at one point needs to generate and open an excel file from a crystal report. It was fairly straight-forward to generate the excel file, but I am having trouble finding anything about initiating the excel-application from my C#.NET code.
Preferably, I'd like to open excel as a stand-alone application on the side rather than incorporating it into the form, though that too is an option. So is there a way to run dos commands from C# or the .NET framework?
So if anyone knows how to do this or at least point me in the right direction, that'd be great.
Thanks,
Fred
Execute third-party program from .NET
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Louis10 pointsPosted Jan 5, 2006, 1:52 AM EST
To execute dos commands I suggest that you write out a .bat file from your C# program. Then you can execute the .bat file by creating and Process object.
Example of running the .bat file
private Process prcFTP = new Process();
prcFTP.StartInfo.FileName = "C:\\filename.bat";
prcFTP.Start(); // run the file
Hope this helps for the dos commands!
Regards
Louis
1 short reply
Fredrik Roaldset26 pointsPosted Jan 10, 2006, 1:05 AM EST