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 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

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

Laisser un commentaire

Veuillez ouvrir une session pour ajouter un commentaire. Pas encore membre ? Rejoignez-nous dès aujourd’hui