Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test for Excel instance?
Message
From
21/02/2002 12:20:53
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00621712
Message ID:
00623238
Views:
19
Borislav:

With Excel 2000 getobject will always create an instance of Excel <s>. So, it wont error, so, you can't trap for it because it wont error.

>OK try this:
>
>old_error = ON("ERROR")
>fl_error = .f.
>ON ERROR fl_error = .t.
>oExcel = GetObject(,"Word.Application")
>IF TYPE("oExcel") # "O" .OR. ISNULL(oExcel) .OR. fl_error
> oExcel = CreateObject("Excel.Application")
>ENDIF
>
>ON ERROR &old_error
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform