jforbes
asked on
Programmatically Creating/Deleting/Renaming Excel Worksheets
I am currently developing a project in Access that takes data and stores it in arrays, and then spits out an Excel Report that can be edited. What I need to be able to do is delete sheet2 and sheet3 from the newly created object and rename Sheet1. The following is a snipet of code that I have been using.
Set ExcelApp = New Excel.Application
ExcelApp.Visible = True
ExcelApp.Workbooks.Add
Set Excelbook = ExcelApp.ActiveWorkbook
Set ExcelSheet = Excelbook.Worksheets("Shee t2")
ExcelSheet.Delete
ExcelSheet.Activate
this works for deleting but Excel wants an answer if deleting is okay, is there a param I send send like I do when I save. Also I would like to know how to change the Sheet name from Sheet1 to like Test1. Thanks in advance, any help is greatly appreciated.
-John
Set ExcelApp = New Excel.Application
ExcelApp.Visible = True
ExcelApp.Workbooks.Add
Set Excelbook = ExcelApp.ActiveWorkbook
Set ExcelSheet = Excelbook.Worksheets("Shee
ExcelSheet.Delete
ExcelSheet.Activate
this works for deleting but Excel wants an answer if deleting is okay, is there a param I send send like I do when I save. Also I would like to know how to change the Sheet name from Sheet1 to like Test1. Thanks in advance, any help is greatly appreciated.
-John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER