View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Creating Workbook with 2 worksheets


or do this?..

dim lSNW&
lSNW = Application.SheetsInNewWorkbook
Application.SheetsInNewWorkbook = 2
workbooks.add
Application.SheetsInNewWorkbook= lSNW





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Rob van Gelder wrote :

There is a setting:
eg.
Application.SheetsInNewWorkbook = 2
(That's VBA, not C++)

However, this is a preference for the user which is saved as Excel is
closed.
When the user next opens Excel, they'll get as many sheets as you
last set.

If I want to create a book with 2 sheets then I write code to add
sheets if they are missing, remove sheets if there are too many.