Using CreateProcess to run Excel

Using CreateProcess to run Excel

I'm successfully using CreateProcess to load a .csv file into Excel. However, I'd like to be able to load the .csv file into an Excel template rather than just raw Excel. The code I'm using is:

if(CreateProcess(null,'excel.exe '//fullname,null,null,false,0,null,null,si,pi)==0)then

where fullname includes the path and the name of the .csv file. I can also open the template I want to use by putting its name in fullname instead of the .csv name, but can anyone tell me how to do both at the same time?

With many thanks


3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.


It looks as if you have to use Excel's COM automation to do that. Not that I'm familiar with it, but CVF AUTODICE sample deals exactly with invoking Excel COM interface. Basically, you have to dig up from Excel VBA documentation how to do that in Excel VBA, and then mimic the same code in Fortran using COM-wizard generated code.


Thanks very much, Jugoslav, I'll give it a go.


Leave a Comment

Please sign in to add a comment. Not a member? Join today