I am creating Excel spreadsheets with tables and graphs
from Access using automation but I would also like to rename the worksheets as I load them with data.
I created a macro in Excel for renaming the worksheet "Sheet1" to "FPY & Rework" but this which gave me the following code:
Within my access code I have the following:
I changed this to:
What is the correct way to change this page name?
Thank you
from Access using automation but I would also like to rename the worksheets as I load them with data.
I created a macro in Excel for renaming the worksheet "Sheet1" to "FPY & Rework" but this which gave me the following code:
Sub Macro1()
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "FPY & Rework"
End Sub
Within my access code I have the following:
Dim objXLSheet As Excel.Worksheet
Set objXLSheet = objXLBook.Worksheets("Sheet1")
I changed this to:
but this gives me a "subscript out of range" error...Set objXLSheet = objXLBook.Worksheets("FPY & Rework")
What is the correct way to change this page name?
Thank you