Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename Sheets - Multi Sheet idw

1 REPLY 1
SOLVED
Reply
Message 1 of 2
rob.j.ross
688 Views, 1 Reply

Rename Sheets - Multi Sheet idw

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

____________________________
Inventor Professional 2014 64 Bit
Windows 7 Professional
NVIDIA Quadro FX 4600
Dual Intel Xeon E5540 CPUs
16GB DDR3 Ram
1 REPLY 1
Message 2 of 2
rob.j.ross
in reply to: rob.j.ross

Found the problem.  oSheet.Name = "New Sheet Name:1" should not include the ":1" at the end.

____________________________
Inventor Professional 2014 64 Bit
Windows 7 Professional
NVIDIA Quadro FX 4600
Dual Intel Xeon E5540 CPUs
16GB DDR3 Ram

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report