All:
Using 2021D
I want to be able to open a .xlsx spreadsheet (1 worksheet) for READ ONLY purposes, then exit Excel, and continue in my program. This code seems to work fine:
Excel = ObjectOpen("Excel.Application")
Excel.visible = @TRUE
; Append Directory to filename and OPEN the Excel file...
ExcelFileName = StrCat(DirScript(), MyFile)
Excel.Workbooks.Open(ExcelFileName)
AWS=Excel.Worksheets(1)
AWS.Activate
; Position cursor to cell A3... First initialize cursor location (row & column)...
RowNum=3
ColNum=1
TheCell=AWS.Cells(RowNum,ColNum)
After I loop thru a few rows & columns, I want to exit Excel (no save), quit the Excel program and continue with my program.. I can't seem to get that to work. I try:
Excel.quit
but I get an error: "3246 Ole Object: Object does not exist, or period used instead of comma"
How can I just exit w/o saving?
Tks in advance