In reading a few of the posts I think I'm getting the sense that Progress may not allow this. Is that a correct assumption?
If Progress is able to open an Excel file and later save it as a .csv how is that done? I am not able to have it save as a .csv. I get the following error message.
"Invalid component handle referenced while processing method/statement: SaveAs. 5884"
I do not release any handles until after the SaveAs statement so I am not sure why this message is happening.
Here is the code segment
assign xSaveAsName = "c:testcsv.csv".
CREATE "Excel.Application" chExcel.
chExcel:Visible=false.
chExcel:Workbooks:OPEN(xfile-name:screen-value).
/* Select a worksheet */
chWorkSheet = chExcel:Sheets:Item(2).
chExcel:Worksheets(2):Activate.
/* Save a new workbook as .csv */
chWorkbook:SaveAs(xSaveAsName,6,,,,,,,TRUE).
/*** Release All Com-handles ***/
release object chExcel no-error.
release object chWorkbook no-error.
release object chWorksheet no-error.
Also if you know of any good reference material about using Excel within Progress that would be appreciated as well.
If Progress is able to open an Excel file and later save it as a .csv how is that done? I am not able to have it save as a .csv. I get the following error message.
"Invalid component handle referenced while processing method/statement: SaveAs. 5884"
I do not release any handles until after the SaveAs statement so I am not sure why this message is happening.
Here is the code segment
assign xSaveAsName = "c:testcsv.csv".
CREATE "Excel.Application" chExcel.
chExcel:Visible=false.
chExcel:Workbooks:OPEN(xfile-name:screen-value).
/* Select a worksheet */
chWorkSheet = chExcel:Sheets:Item(2).
chExcel:Worksheets(2):Activate.
/* Save a new workbook as .csv */
chWorkbook:SaveAs(xSaveAsName,6,,,,,,,TRUE).
/*** Release All Com-handles ***/
release object chExcel no-error.
release object chWorkbook no-error.
release object chWorksheet no-error.
Also if you know of any good reference material about using Excel within Progress that would be appreciated as well.