I'm still a newbee at this, but let's see what I can come up with. The first thing is that you have to translate the VBA into valid VFP code. So, "False" needs to become ".F.".
I would suggest looking up the "SaveAs" function in the automation help and see if you can figure out the format. As it is, I can see that VFP is going to choke. If everything starting with "FileName" are parameters, then maybe putting () around it would help. You'd also need quotes around each parameter. That should be enough to get Fox to accept it, but whether Excel would accept it, I don't know.
If that doesn't work, a new post in the OLE Automation category should get help from someone more advanced than me. I've only done really basic tinkering with other peoples' code. :)
Hope that helps,
Michelle
>thanks for the info and code. works well. but now i want to save the workbook as a specific name in a specific folder. went into excel, recorded a macro and then look at the VB code. i added the oExcel. before the ActiveWorkbook.Saveas. but i get a syntax error when i execute it in the command window.
>
>oExcel = CREATEOBJECT('Excel.Application')
>oExcel.workbooks.add
>oExcel.ActiveWorkbook.SaveAs FileName:="C:\Book3.xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement