Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find full name of Excel open file
Message
From
26/10/2012 13:45:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Find full name of Excel open file
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01555893
Message ID:
01555893
Views:
53
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?

Is there an alternate way of saving the file without getting the SaveAs dialog box?

Thanks to all.......Rich
Next
Reply
Map
View

Click here to load this message in the networking platform