Programmatically Creating/Deleting/Renaming Excel Worksheets
Posted on 2000-03-16
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
Set Excelbook = ExcelApp.ActiveWorkbook
Set ExcelSheet = Excelbook.Worksheets("Sheet2")
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.