
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I've created a basic If...Then...End If command to change the sheet size across all sheets in the idw file and zoom-extents on all sheets. BUT, I've come to find out that if I delete one of the sheets, it kinda-sorta messes with the flow (the message "ThisDrawing.Sheet: No sheet named XXXX was found") and the zoom-extents rule does not run.
So, I was wondering if there's any way to possibly simplify the code such that it won't require the precise names of each individual sheet for it to work. This way, if the user deletes one sheet, the rule can still maintain the same functionality.
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 20052 StartFragment: 314 EndFragment: 20020 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
If Sheet_Size = "Letter (8.5 x 11)" Then ActiveSheet = ThisDrawing.Sheet("Primary Plant:1") ActiveSheet.ChangeSize("A", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Primary Plant:2") ActiveSheet.ChangeSize("A", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 1:3") ActiveSheet.ChangeSize("A", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 1:4") ActiveSheet.ChangeSize("A", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 2:5") ActiveSheet.ChangeSize("A", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 2:6") ActiveSheet.ChangeSize("A", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Primary Plant:1") iLogicVb.RunRule("Auto-Zoom to Extents") ElseIf Sheet_Size = "Tabloid (11 x 17)" Then ActiveSheet = ThisDrawing.Sheet("Primary Plant:1") ActiveSheet.ChangeSize("B", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Primary Plant:2") ActiveSheet.ChangeSize("B", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 1:3") ActiveSheet.ChangeSize("B", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 1:4") ActiveSheet.ChangeSize("B", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 2:5") ActiveSheet.ChangeSize("B", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Alternate Plant 2:6") ActiveSheet.ChangeSize("B", MoveBorderItems := True) ActiveSheet = ThisDrawing.Sheet("Primary Plant:1") iLogicVb.RunRule("Auto-Zoom to Extents") End If
Solved! Go to Solution.