Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to update an worksheet in a general field programatically ?

Status
Not open for further replies.

pxw

Programmer
Jan 6, 2002
86
AU
I am using the following code to create and save an Excel worksheet programatically. It works fine.
oExcel=CreateObject("Excel.Application")
oExcel.visible=.T.
oExcel.Workbooks.Open("TempWorksheet")
.Range("F3").Value =thisform.Txtclientname.value
.Range("F4").Value =thisform.Txtclientcode.value
.......
oExcel.ActiveWorkbook.SaveAs("NewWorksheet")
oExcel.ActiveWorkbook.close
oExcel.Quit()
use EST
append blank
append general ESTForm FROM "NewWorksheet" CLASS EXCELCHART
use in EST

My question: is there any way to update F3,F4,... programatically?
Currently, I update the worksheet manually by using,
use EST
MODIFY GENERAL ESTform

Any help would be appreciated.



Peter
Australia
 
You mean modify the worksheet without Automating Excel? No I believe that is not possible. I believe the way you are doing it is the right way.
 
hi mgagnon,

Thanks for your comments.

What I need is to add some equipment from TABLE1.DBF into the existing worksheet in a general field of TABLE2.DBF programatically.

With 'MODIFY GENERAL ESTform', users have to manually enter all the information into the worksheet, even those information is in another table already.

In general, with VFP, is there any way to update an object in a general field programatically?



Peter
 
Well, you can put code similar to the one you wrote but this time open the table, SCAN.. ENDSCAN thru your table, then use Cells( i, col#).Value = fieldname

 
hi dylim,
The problem is I don't know how to call up Excel to open an exisiting spreadsheet saved in a general filed.

With CreateObject("Excel.Application"), a new spreadwheet can be created. With Getobject(), an exsiting spreadsheet can be openned and update using the codes you mentioned above. However, I can not figure out how to use Getobject() for a spreadsheet existing in a general field.

Any comments would be apreciated.



Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top