Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I use the worksheet codename extensively throughout my add-ins. However at
times I get errors because the codemame is not initialized at the point in the code where it is being referenced. For example, if I add something like this to my code.... sub Test (ws as Worksheet) dim str as string str = ws.CodeName if str = "" then debug.print "Missing Codename" else debug.print "CodeName = " & ws.Codename end sub I sometimes will get "Missing Codename", and other times (for the same worksheet), it returns the code name. If I try stepping through the code, it will always return a value for CodeName. I have narrowed the occurrence of the problem down to being when the worksheet uses the default code name (Sheet#) and the code is run either during the workbook open event, or is run using a worksheet that was just added to the workbook. Any ideas on how to resolve this problem? This happens in both Exccel 2000 and 2003. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Codename not set | Excel Programming | |||
Using a sheet's 'Codename' | Excel Programming | |||
Codename passing | Excel Programming | |||
VBA codename and codeprotection | Excel Programming | |||
codename help | Excel Programming |