Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open xls file
Message
From
24/08/2007 02:55:00
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01249856
Message ID:
01250098
Views:
20
>
>MYFILE = "C:\MY FILE\TEST.XLS"
>lcFileName = ["] + MYFILE + ["]
>oShell = CREATEOBJECT('WScript.Shell')
>oShell.Run(lcFileName)
>
Hi Sergey,
I don't understand why he needs these extra pair of quotes ?
lcFileName = "C:\test.xls"
oShell = CREATEOBJECT('WScript.Shell')
oShell.Run(lcFileName)
Will work just fine. It could be that OP created problem at first place by
doing typo like
MYFILE = "C:\MY FILE\TEST.XLS"
lcFileName = [MFILE]  &&MFILE<>MYFILE
BTW Thank you very much for this answers because it answered for me
few long unanswered questions; How to open TIF file with MSOV and also how to open XPS file with XPS viewer.

Well this WScript.Shell call answers them both :)
And was so simple.
lcFileName = 'C:\test.tif' && or = 'C:\test.xps'
oShell = CREATEOBJECT('WScript.Shell')
oShell.Run(lcFileName)
Works for both :)


I am guessing that running this shell call is the same as doing dbl-click
on any file which consecutively opens file with app associated with file extension.
Or I am wrong ?



>
>>
>>
>>Thank for you help, i have try your code. It is work :)
>>
>>
>>*lcFileName = ["C:\TEST.XLS"]
>>lcFileName = ["C:\MY FILE\TEST.XLS"]
>>oShell = CREATEOBJECT('WScript.Shell')
>>oShell.Run(lcFileName)
>>
>>
>>But it can't work when i put a variable as below:-
>>
>>MYFILE = "C:\MY FILE\TEST.XLS"
>>lcFileName = [MFILE]
>>oShell = CREATEOBJECT('WScript.Shell')
>>oShell.Run(lcFileName)
>>
>>I have try to use:
>>lcFileName = [&MFILE]
>>lcFileName = [(MFILE)]
>>But still can not work !!!
>>
>>Many thanks for you help
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform