Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know if Excel Workbook is already opened
Message
 
 
À
29/03/2007 08:05:31
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 5
Divers
Thread ID:
01209471
Message ID:
01209676
Vues:
12
>>Hi All,
>>
>>Using Excel automation I want to open an Excel Workbook if it is not already open. How to check for this?
>>
>
>You can loop through the open workbooks and see if one of them is the one you're interested in:
>
>
>FOR EACH oWB in oXL.Workbooks
>  IF oWB.Name == m.cFileName
>     * Found it
>  ENDIF
>ENDFOR
>
>
>I don't remember offhand whether the Name property is the right one and whether it includes a path, but you can figure that out from Help.
>
>Tamar

I think this technique may work if the Excel file is on the local computer and you get a reference to Excel with GetObject.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform