Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to start Excel with a speific file in VFP?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00353059
Message ID:
00353401
Views:
16
>>>I want to click a buttom to lunch Excel with a excel document which a get from getfile().
>>
>>In the click event of the button:
>>
>>lcFilename = GETFILE()
>>
>>IF !EMPTY( lcFileName )
>> oShell = CREATEOBJECT( "Shell.Application" )
>>
>> oShell.Open( lcFilename )
>>ENDIF
>>
>>This uses the Windows Script Host (WSH), which has become a hot topic on the UT. If you have any questions about it, do a search for WSH.
>
>No, this is using the Shell object, which is not a part of WSH, but is an automation object completely independent of WSH (the real requirement is the presense of an Active Desktop compliant shell on the system) and requires that older non-compliant OS releases to install IE4 or apply service patches to get the missing pieces.
>
>The Open method of the Shell.Application object is doing the equivalent of launching the document with ShellExecute(), although it can do more since it will create an InternetExplorer.Application object instance if you launch a folder with it. For this use, either the _ShellExecute() class from the VFP6 FFC or using the ShellExecute() API call (there are about 8.7 billion examples of this on UT in the past, and at least one in the FAQ) will work just fine.

Thanks Ed. I guess I've just been brainwashed with WSH from you and George *g*.
Chris McCandless
Red Sky Software
Previous
Reply
Map
View

Click here to load this message in the networking platform