>>I want to click a buttom to lunch Excel with a excel document which a get from getfile().
>
>You could use ShellExecute and not use OLE Automation:
>
>
DECLARE INTEGER ShellExecute IN "Shell32.dll" LONG, STRING, STRING, STRING, STRING, LONG
>?ShellExecute(0,"Open","myexcelfile","","",0)
Unless you want to do something with the file automatically. I have a conversion routine where I copy a cursor to an excel file, then launch Excel via OLE. I needed to create a pdf file from Excel so the guys could download it from the web server. I recorded a macro in Excel to do the rest of the job. The code was something like this:
lcfile='\\myserver\myshare\myfolder\thisexcel.xlt''
oexcel=create('excel.application')
oexcel.visible = .t.
oexcel.workbooks.open(lcfile)
oexcel.run('mymacro')
Five lines of code basically without having to mess with all the movements from within VFP.
John Harvey
Shelbynet.com
"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright