Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Object Name
On creating a new worksheet I can set the name of it (the
text shown on the tab) but I can't set the object name. The properties of the sheet contain a object name property shown as "(name)" which I cant grab hold of in VBA. Can anyone help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Object Name
The CodeName preoperty is read-only but can be changed through the VBE.
ThisWorkbook.VBProject.VBComponents. _ Item(ActiveSheet.CodeName).Properties("_CodeName") .Value = "NewName" For this to work, you need to set a reference to the VBE Extensibility Library. -- Vasant "Andy" wrote in message ... On creating a new worksheet I can set the name of it (the text shown on the tab) but I can't set the object name. The properties of the sheet contain a object name property shown as "(name)" which I cant grab hold of in VBA. Can anyone help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Object Name
ThisWorkbook.VBProject.VBComponents. _
Item(ActiveSheet.CodeName).Properties("_CodeName") .Value = "NewName" This can be shortened to ThisWorkbook.VBProject.VBComponents(ActiveSheet.Co deName).Name = "NewName" No reference to the Extensibility library is required. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... The CodeName preoperty is read-only but can be changed through the VBE. ThisWorkbook.VBProject.VBComponents. _ Item(ActiveSheet.CodeName).Properties("_CodeName") .Value = "NewName" For this to work, you need to set a reference to the VBE Extensibility Library. -- Vasant "Andy" wrote in message ... On creating a new worksheet I can set the name of it (the text shown on the tab) but I can't set the object name. The properties of the sheet contain a object name property shown as "(name)" which I cant grab hold of in VBA. Can anyone help |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet Object Name
Thanks for the correction, Chip!
-- Vasant "Chip Pearson" wrote in message ... ThisWorkbook.VBProject.VBComponents. _ Item(ActiveSheet.CodeName).Properties("_CodeName") .Value = "NewName" This can be shortened to ThisWorkbook.VBProject.VBComponents(ActiveSheet.Co deName).Name = "NewName" No reference to the Extensibility library is required. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message ... The CodeName preoperty is read-only but can be changed through the VBE. ThisWorkbook.VBProject.VBComponents. _ Item(ActiveSheet.CodeName).Properties("_CodeName") .Value = "NewName" For this to work, you need to set a reference to the VBE Extensibility Library. -- Vasant "Andy" wrote in message ... On creating a new worksheet I can set the name of it (the text shown on the tab) but I can't set the object name. The properties of the sheet contain a object name property shown as "(name)" which I cant grab hold of in VBA. Can anyone help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Charts and Charting in Excel | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Discussion (Misc queries) | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Excel Worksheet Functions | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | New Users to Excel |