Modificación de CodeName con código VB excel

Arturo Enrique Solano Calderón 26 Reputation points
2019-11-01T21:23:38.043+00:00

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 Monitored
Not Monitored
Tag not monitored by Microsoft.
39,947 questions
0 comments No comments
{count} vote

Accepted answer
  1. Philippe Levesque 5,806 Reputation points
    2019-11-02T00:26:41.133+00:00

    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

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.