Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I detect if Excel is already running?
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
How can I detect if Excel is already running?
Miscellaneous
Thread ID:
00158064
Message ID:
00158064
Views:
68
In various places in our application I use the following code to create an Excel object and export data:-

oExcel=CREATEOBJECT("Excel.Application")
oExcel.Workbooks.Add()
IF UPPER(oExcel.Name)= "OBJECT"
lHasExcel97 = .T.
oExcel = oExcel.Sheets[1]
ELSE
lHasExcel97 = .F.
ENDIF


This works nicely if Excel is not yet running but if the user already has Excel running on his PC then this code will again invoke Excel rather than use the existing Excel application.

How can I change the code to detect if Excel is already running and, if so, simply add a new Workbook to the existing Excel application.

cheers,

Alain Legrand
Next
Reply
Map
View

Click here to load this message in the networking platform