View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Andy Andy is offline
external usenet poster
 
Posts: 33
Default Worksheet codename

On previously asking for help on renaming the object name
of a worksheet I got the responce(s) below but can't get
either to work, I know the codename property is correct
as I can view the object name in a message box, I just
can't rename it. Can anyone offer me some further help.
Ta
Andy

(This one requires Extensibility library ref)
ThisWorkbook.VBProject.VBComponents.Item
(ActiveSheet.CodeName).Properties("_CodeName").Val ue
= "NewName"

or


ThisWorkbook.VBProject.VBComponents
(ActiveSheet.CodeName).Name = "NewName"