Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Office Excel.2007 won't automate
Message
From
31/10/2020 11:01:10
 
 
To
28/10/2020 16:14:31
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01676837
Message ID:
01676889
Views:
30
If the createobject line errors out, a variation of Al's idea probable - multiple versions of Excel or remains thereof in registry.

The other gotcha for heavy COM objects is sometimes internal state of loading object, esp. true in IE/WebBrowser. This should only happen AFTER createobject(), if that is the case, throwing in Doevents or Wait Window Timeout xxx should help.

Band aid/ugly patch would be to persist last run of Excel and if needed run it via run/! before automating it. GetObject() to such an instance reads well in documentation, but has problems as well - createobject() most f the time better even if running instance is guaranteed.

HTH
thomas

>Office Excel.2007 won't automate unless it has run once.
>
>m.loExcel = CreateObject("Excel.Application")
>Error Ole error code 0x80080005: Server execution failed.
>With (m.loExcel)
> * do neat excel stuff here
>Endwith && excel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform