Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel Automation Formatting and F9
Message
From
26/02/2010 00:17:36
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01372023
Message ID:
01451145
Views:
50
Hi,
I add the code to my program, but it NOT insert the line at the beginning of the row 1.
oExcel = CREATEOBJECT([Excel.Application])
oWorkbook = oExcel.Workbooks.open("C:\WTS\MID\WTS77XLS.XLS")
oExcel.Visible = .t.
oExcel.activesheet.Range("A1").value = "Client Code"
oExcel.activesheet.Range("B1").value = "Client Name"
oExcel.activesheet.Range("C1").value = "Invoice No."
oExcel.activesheet.Range("D1").value = "Amount"
lnLastRow = oExcel.activesheet.UsedRange.Rows.Count
 lnLastCol = oExcel.activesheet.UsedRange.Columns.Count
oExcel.activesheet.Range("D2:D"+TRIM(PADR(lnLastRow+1,11))).NumberFormat ='###,###,###.00' 
oExcel.activesheet.ROWS("1:1").INSERT(xlShiftDown)
Previous
Reply
Map
View

Click here to load this message in the networking platform