I Have code renaming a worksheet codename that runs find in DEBUG but trips in RUNTIME with:
Runtime error '1004'
Method '_CodeName' of object '_Worksheet' failed
Code is part of an excel template that generates a project environment whenever a new excel workbook is generated ( from the template)
The code trips on the codename change, not on the name change.
I have tried to ws_projects_defintion.activate and .select preceding the code name change to no avail. Anyone an idea what I am overlooking?
Runtime error '1004'
Method '_CodeName' of object '_Worksheet' failed
Code is part of an excel template that generates a project environment whenever a new excel workbook is generated ( from the template)
VBA Code:
Set ws_projects_definition = wb.Sheets.Add(After:=wb.Sheets(wb.Sheets.Count))
ws_projects_definition.name = "projects"
ws_projects_definition.[_CodeName] = "ws_projects_defintion"
The code trips on the codename change, not on the name change.
I have tried to ws_projects_defintion.activate and .select preceding the code name change to no avail. Anyone an idea what I am overlooking?