Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changes To Excel File Not Saving
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Changes To Excel File Not Saving
Miscellaneous
Thread ID:
01333224
Message ID:
01333224
Views:
56
I had this working and now it's now saving:
** Instantiate Excel
oExcel = CREATEOBJECT("Excel.Application")

** Open the workbook
oWorkbook = oExcel.Workbooks.Open(sFileName)
 
** Get a reference to the sheet
oSheet = oExcel.Workbooks(1).ActiveSheet

** Select all cells
oSheet.Cells.Select()

** Autofit the cells
oSheet.Cells.EntireColumn.AutoFit()

** Turn on auto filtering
IF NOT oSheet.AutoFilterMode
   oExcel.Selection.AutoFilter
ENDIF
			
** Save the changes
oWorkbook.Save()

** Close the workbook and quit Excel
oWorkbook.Close()
oExcel.Quit()
When the oWorkbook.Close() line is run, I get prompted to save changes. Anyone know what I did wrong?

Also, how do I unselect the selection in code?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform