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

Naming an Excel workbook and worksheets 2

Status
Not open for further replies.

chandler

MIS
Dec 10, 2000
66
0
0
US
I've been looking for a way to name the workbooks and worksheets I create using VFP 9.0 So far I've found ways to create and select, but not to name. Any help is much appreciated.



Chandler
I ran over my dogma with karma!
 
You try the following code
Code:
oExcel = CREATEOBJECT("Excel.application")
oWorkBook = oExcel.Workbooks.Add()
oWorkbook.Sheets.Add

osheet=oexcel.ActiveSheet
osheet.Name='My sheet Name'
osheet.SaveAs('c:\Mydirectory\MyfileName',43) &&Save in Excel 97 format
oexcel.Visible=.t.


 
Worked like a charm. Muchas Gracias.

Chandler
I ran over my dogma with karma!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top