Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Charts and Charting in Excel 3 August 24th 06 07:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Discussion (Misc queries) 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet [email protected] Excel Worksheet Functions 2 August 24th 06 05:26 PM
plot graph from multiple worksheet as embedded chart object on every worksheet jeftiong New Users to Excel 0 August 23rd 06 01:50 PM


All times are GMT +1. The time now is 01:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"