Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Object
Message
From
02/11/2015 05:48:31
Olatunji Beckley
O. A. Beckley Ventures
Nigeria
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Excel Object
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01626827
Message ID:
01626827
Views:
57
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
Map
View

Click here to load this message in the networking platform