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

Mike

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Michael,

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.

Jugoslav

Jugoslav www.xeffort.com

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

Mike

Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied? Jetzt teilnehmen