Renaming a Sheet
Renaming a Sheet
(OP)
How would I set the name of an excel sheet. I would use the following code to access the sheet object
Set excelReport = CreateObject("Excel.Application")
excelReport.Workbooks.Add
Set excelSheet1 = excelReport.ActiveWorkbook.WorkSheets(1)
Set excelSheet2 = excelReport.ActiveWorkbook.WorkSheets(2)
Set excelReport = CreateObject("Excel.Application")
excelReport.Workbooks.Add
Set excelSheet1 = excelReport.ActiveWorkbook.WorkSheets(1)
Set excelSheet2 = excelReport.ActiveWorkbook.WorkSheets(2)
RE: Renaming a Sheet
hi,
CODE
set xl = CreateObject("Excel.Application")
with xl.workbooks.add
.worksheets(1).name = "Whatever"
.saveas "your_choice.xlsx"
.close
end with
xl.quit
set xl = nothing
Skip,
Just traded in my old subtlety...
for a NUANCE!