I need to rename the sheets of a multiple sheet idw. This should be easy but for some reason I cannot change the sheet names. I get no errors it just does not change. Here is the VBA code:
'Open drawing document
Set oDrawingDoc = ThisApplication.Documents.Open(sPath, True)
'Set the sheets collection
Set oSheets = oDrawingDoc.Sheets
'Cycle through sheets
For Each oSheet In oSheets
If oSheet.Name = "Test:1" Then
oSheet.Activate
oSheet.Name = "New Sheet Name:1"
Else
End If
oSheet.Update
Next
oDrawingDoc.Update
oDrawingDoc.Save
oDrawingDoc.Close
Solved! Go to Solution.
Solved by rob.j.ross. Go to Solution.
Found the problem. oSheet.Name = "New Sheet Name:1" should not include the ":1" at the end.