Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error message
Message
 
 
À
12/06/2007 09:40:50
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01232179
Message ID:
01232267
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform