Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I detect if Excel is already running?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
How can I detect if Excel is already running?
Divers
Thread ID:
00158064
Message ID:
00158064
Vues:
70
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform