WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Set Number of Sheets in Workbook


;Winbatch 2005B - pre-set number of sheets in workbook
nSheets = 7

oXL=0
oXL = CreateObject("Excel.Application")
If oXL == 0 Then Exit
oXL.Visible          = 1  
oXL.ScreenUpdating   = 1   
oXL.UserControl      = 1
oXL.DisplayAlerts    = 0
nOld = oXL.SheetsInNewWorkbook 
oXL.SheetsInNewWorkbook = nSheets 
oXL.WorkBooks.Add()
oXL.SheetsInNewWorkbook = nOld

oXL=0
display(2,"End of Demo","You Should Have %nSheets% Worksheets")
Exit

Article ID:   W17161
File Created: 2007:07:03:14:28:32
Last Updated: 2007:07:03:14:28:32