question

ArturoEnriqueSolanoCaldern-2059 avatar image
ArturoEnriqueSolanoCaldern-2059 asked ·

Modificación de CodeName con código VB excel

CodeName modification with excel VB code
Good evening. I have the following code:

'I create a sheet with the following code
Worksheets.Add(After:=ActiveSheet).Name = "Nombre de la pestaña de la hoja"

'Change the CodeName
ThisWorkbook.VBProject.VBComponents.Item(Sheets(ActiveSheet.Index).CodeName).Properties("_CodeName").Value = "Nombre del CodeName"

Perform the action but immediately after modifying the Internal Name of the sheet, send me the following:

"You cannot enter the interruption time at this time" I know that I can continue or finish the compilation, but when I continue, it shows me the following.

"Error '9' has occurred at runtime:" "Subscript out of range"

Do you know why this happens and how to correct it?

Thanks in advance for your attention and support

not-supported
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

yagmoth555 avatar image
yagmoth555 answered ·

Hi

Please edit to add the revelant text into english. The main language on Q&A is just English as we speak.

For forum in other language(s) you can still use Technet/MSDN forums for that matter.

Thanks you for your understanding

5 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


I don't know if I translated it well, I need a little practice, but if you can support me I would appreciate it very much

0 Votes 0 · ·
jun-4948 avatar image jun-4948 ArturoEnriqueSolanoCaldern-2059 ·

Arturo,
Are you trying to rename the newly created worksheet?

 Worksheets.Add(After:=ActiveSheet).Name = "Nombre de la pestaña de la hoja"
 Sheets(ActiveSheet.Index).Name = "Nombre del CodeName"

1 Vote 1 · ·

Yes, I need to create the table and rename it, in case I am going to add more formulas inside the table, if the user changes the NAME property, it does not affect because the code points to the CodeName.

0 Votes 0 · ·
Show more comments