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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to Excel, Pls help!

Status
Not open for further replies.

handlehandle

Technical User
May 23, 2000
1
HK
I have an existing excel file and I want to export some datas to the specific cells. How can I do? Pls show the command if you have any suggestion.

Thanks in advance!!

Shukpak
4 May
 
Your going to have to become familiar with Excels; COM Object model. you can get documentation on it for microsofts web site.

I'm still using Office 97 the help file comes with it is
VBAXL9.CHM Excel Object help file

Here is little taste of the kind of code you'll have to get very familiar with.

oExcel = CREATEOBJECT('Excel.Application')
oExcel.Visible = .T.
oExcel.application.workbooks.add
oExcel.application.workbooks(1).activate
oExcel.application.workbooks(1).sheets(1).activate
oExcel.quit &&Excell will prompt you to save the file
RELEASE oExcel

There is forum here at Tek-Tips devoted to this type of programing. It is mostly VB programmers there but the syntax is very similar. -Pete
 
I have a similar problem. What I do is to maintain an intermediate data table with the same structure as the Excel file. I update this from my application under FoxPro's control and then export the whole of the intermediate table to XLS format, thereby overwriting the old version. This method does assume that no-one else is going to want to edit the Excel file in between your updates.

ajpa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top