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!

Excel automation

Status
Not open for further replies.

fluppe689

Programmer
Jul 11, 2008
75
BE
Dear Experts

oExcelObject = CREATEOBJECT('Excel.Application')
*
WITH oExcelObject
.Application.Workbooks.Add
.APPLICATION.DisplayAlerts = 0
.APPLICATION.DisplayAlerts = 1
.Application.Worksheets(1).Activate
.Application.Worksheets(1).name = "DETAIL"
ENDWITH
I know this open an excel with 3 sheets

How can i open an excel with for example 10 sheets or variabel sheers (1 sheet per account manager)

Wfg,

Filip
 
Hi Filip,

You need to call the Sheets.Add method. Call it once for each sheet to be added. By default, the sheets will be named "Sheet4, "Sheet5", etc. But you can later rename them by changing the Name property.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
If you had looked into the FAQ's of this forum area and done a Search within the webpage for Excel you would have found a number of Excel Automation examples.

One of those that might be of particular help for you might be:
Useful Excel Automation examples.
faq184-4266


Good Luck,
JRB-Bldr


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top