Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find full name of Excel open file
Message
De
26/10/2012 14:02:48
 
 
À
26/10/2012 13:45:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01555893
Message ID:
01555895
Vues:
80
This message has been marked as the solution to the initial question of the thread.
>We have a number of places in our system where we do something like
>COPY TO (lcFileName) XLS
>oxl = CREATEOBJECT("Excel.application")
>oxl.displayalerts = .F.
>lcFileName = "something"
>oxl.workbooks.open(lcFileName)
>
>do stuff
>
>oxl.save()
>
>We now have a mixture of machines with Excel 2007 and older versions of Excel. The 2007 machines are now opening a dialog box asking for a filename to save in XLSX format.
>
>I've resolved that issue (perhaps not in the best way - but it seems to work) by re-coding the Save() command as
>oxl.activeWorkbook.saveAs(lcfilename,39)  && save in XLS format
>
>We have a situation, however, where a subroutine has received the Excel object as a parameter. This subroutine performs a save operation. In order to convert to the new save process I need to know the filename.
>
>While I could modify the routines to pass the name of the file, it seems more generic to get the name from the Excel object itself (if possible)
>oxl.activeworkbook.name
will give me the file name, but without the complete path.
>
>Is there some other property/method I can use to get the complete file name?

Try the Fullname property.
>
>Is there an alternate way of saving the file without getting the SaveAs dialog box?

Would setting DisplayAlerts to .F. do the trick?

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform