Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modifying XLS file on the form opened with _webview.vcx
Message
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00877610
Message ID:
00878081
Views:
36
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform