Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to start Excel with a speific file in VFP?
Message
 
To
30/03/2000 23:45:32
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00353059
Message ID:
00353262
Views:
18
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform