General information
Title:
How To Change Excel Column Names From VFP
I am calling Excel from VFP 6.0. I need to change some of the column names programmatically. I've gotten this far:
1. startup Excel
2. select the desired spreadsheet
3. select the desired cell
But here I am stuck.
Here's the code I used for the above steps:
1. ThisForm.oExcel = CreateObject("Excel.Application")
2. ThisForm.oExcel.Workbooks.Open("my spreadsheet")
3. ThisForm.oExcel.Range("E1").Select && selects the 5th column
For the 4th step, I've tried things like: ActiveCellFormulaR1C1 = "the desired text"
This actually works when executed from the VFP command window (substituting a private variable for the object reference to Excel instead of "Thisform.oExcel"), but it blows up when it executes in code.
TIA, Chaim
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