Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modifying XLS file on the form opened with _webview.vcx
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00877610
Message ID:
00878081
Vues:
39
>Hi All,
>i wantto open a XLS file via _webview.vcx on the form and wantto modify it after . How ?
>
I placed the Web Browser control on a form, instead of using _webview.vcx.
Say the file name is "C:\test\one.xls".
To load that:
DECLARE Sleep IN WIN32API ;
  AS Sleep INTEGER

THISFORM.oleWebBrowser.Navigate( "C:\test\one.xls" )
* Wait until ReadyState = complete.
DO WHILE THISFORM.oleWebBrowser.Object.ReadyState <> 4  
	* Don't use INKEY(), or you will never reach that state!
	Sleep( 001 )
ENDDO

* Note that Excel creates an invisible spreadsheet with a name like "Object".
* So make your changes to:  
*   THISFORM.oleWebBrowser.Object.Document.Application.Workbooks( "one.xls" )

* And save your changes with this code:
THISFORM.oleWebBrowser.Object.Document.Application.Workbooks( "one.xls" ).Save()
- Andy Rice
San Diego, CA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform