OrWolf
MIS
- Mar 19, 2001
- 291
I'm trying to add a new workbook with only 1 sheet. When I attempt to delete the two extra sheets Excel throws warning messages that I don't want. Does anyone know how to suppress / hide these warning messages?
My code:
Set appExcel = CreateObject("Excel.Application")
Set newBook = appExcel.Workbooks.Add
newBook.Worksheets(1).Name = "CustomerList"
newBook.Worksheets(2).Delete FALSE
newBook.Worksheets(2).Delete FALSE
newBook.Worksheets(1).Activate
Set oSheet = newBook.Worksheets(1)
My code:
Set appExcel = CreateObject("Excel.Application")
Set newBook = appExcel.Workbooks.Add
newBook.Worksheets(1).Name = "CustomerList"
newBook.Worksheets(2).Delete FALSE
newBook.Worksheets(2).Delete FALSE
newBook.Worksheets(1).Activate
Set oSheet = newBook.Worksheets(1)