Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error message
Message
 
 
To
12/06/2007 09:40:50
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01232179
Message ID:
01232267
Views:
12
I've tried the following simple code (bellow) based on my third idea, because I don't have time right now to explore my second idea (which is presumably better):
declare long ShellExecute in "shell32.dll" ;
	long hwnd, string lpszOp, ;
	string lpszFile, string lpszParams, ;
    string lpszDir, long nShowCmd
ShellExecute(0,'Open',GETFILE('xls'),'','',1)
DECLARE Sleep IN kernel32 INTEGER dwMilliseconds 

Sleep(1000*30) && Hopefully half a minute would be enough to change one value

TRY
   loExcel = GETOBJECT(,'Excel.application') 
   IF VARTYPE(m.loExcel) = 'O'
      *loExcel.Save(.t.)  - doesn't work, so users may need to also press Save button themselves
      loExcel.Quit()
   ENDIF      
CATCH TO loError
    * Problem
ENDTRY
>hi,
>thank you so much ,
>i need to close myexcel sheet before import it,
>via simple code. if it is possible
>
>
>CLOSE all
>SET DATE BRITISH
>SET CENTURY on
>thisform.text9.Value=GETFILE('xls')
>
>   declare long ShellExecute in "shell32.dll" ;
>	long hwnd, string lpszOp, ;
>	string lpszFile, string lpszParams, ;
>    string lpszDir, long nShowCmd
>ShellExecute(0,'Open',thisform.text9.Value,'','',1)
>***************************************
>IMPORT FROM (thisform.text9.value) TYPE xls
>
>thanks
>>>>>>>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform