Solved

excel 2010 VBA - Can't change code name of sheet (read only error)

Posted on 2013-11-09
2
428 Views
Last Modified: 2013-11-11
Testing out a simple procedure and it isn't working.
I'm trying to rename the code name of a sheet (see graphic for code and error.
That property is definitely NOT read only.  I can change it manually.  Why not using code?


 rer
0
Comment
Question by:brothertruffle880
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39636416
If the sheet is protected try unprotecting it.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 39636435
Not everything that you can do manually can be done through code.

Just press F1 on CodeName, and if the VBA help was installed on the station, you will see that CodeName Property "Returns the code name for the object. Read-only String".

And a little further down in help, it is said that you can change it in design, but "you cannot programmatically change this property at run time."
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question