General information
Category:
Coding, syntax & commands
Environment versions
Network:
Windows 2008 Server
In the code below, the .ACTIVEWORKBOOK.SAVE command generates an OLE error "Unable to get the Save property of the Workbook class"
COPY TO &EXCELFILE TYPE XLS
O_EXCEL=CREATEOBJECT("EXCEL.APPLICATION")
O_EXCEL.VISIBLE=.T.
O_WORKBOOK=O_EXCEL.WORKBOOKS.OPEN(RTEXTFILE)
WITH O_EXCEL
.RANGE("A1").SELECT
.SELECTION.ENTIRECOLUMN.DELETE
*
.RANGE("A1").VALUE="Account No."
.RANGE("B1").VALUE="Account Name"
.RANGE("C1").VALUE="Amount"
*
.RANGE("A1").SELECT
.SELECTION.ENTIREROW.INSERT
.RANGE("A2").SELECT
.SELECTION.ENTIREROW.INSERT
.RANGE("A3").SELECT
.SELECTION.ENTIREROW.INSERT
.RANGE("A4").SELECT
.SELECTION.ENTIREROW.INSERT
*
.RANGE(.CELLS(1,1),.CELLS(5,3)).FONT.NAME="ARIAL"
.RANGE(.CELLS(1,1),.CELLS(5,3)).FONT.SIZE=10
.RANGE(.CELLS(1,1),.CELLS(5,3)).FONT.BOLD=.T.
.RANGE("A1").VALUE=RCOYNAME
.RANGE("A2").VALUE="General Ledger Report"
.ACTIVEWORKBOOK.SAVE
ENDWITH
RELEASE O_EXCEL
1) Does anyone know the solution to this problem?
2) I also want to open an Excel file, format the columns and save as a CSV file from my program. Does anyone have a comprehensive list of the object's properties to achieve all these?
Regards.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only