Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to add a new worksheet and then retrieve its
codename with the following code: Sub alpha() ThisWorkbook.Sheets.Add sNewShtName = ActiveSheet.Name MsgBox (Sheets(sNewShtName).CodeName) End Sub If the Visual Basic Editor is open, I can retrieve the codename without any problem. However, if the Visual Basic Editor is closed then Excel cannot seem to retrieve the worksheet codename. Moreover it remains unable to retrieve the codename until I open the Visual Basic Editor (even if I save and or close down the workbook and shut down the application. Finally, it makes no difference whether I add the worksheet programmatically or manually Does anybody know of a way to retrieve the codename of a newly added worksheet without opening the Visual Basic Editor? Thanks Alasdair Stiring |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loops with sheet codenames | Excel Discussion (Misc queries) | |||
Use Sheet CodeNames to Select Sheet in Different Workbook | Excel Discussion (Misc queries) | |||
Using worksheet codenames | Excel Programming | |||
From my Addin, referring to activeworkbook's sheets by their codenames | Excel Programming | |||
strange worksheet.codenames in XL97 | Excel Programming |