- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
You can do a lot of things with a drawing without ever visibly seeing it. For example,
Set oNewDocument = ThisApplication.Documents.Open("FullFileNamePath", False)
My question is how do you activate the sheets when it is not showing?
For Example, I have a For statement to delete the title block on each sheet:
For oSheetNumber = 1 To oDoc.Sheets.Count
oDoc.Sheets(oSheetNumber).Activate
Set oSheet = ThisApplication.ActiveDocument.ActivateSheet
oSheet.TitleBlock.Delete
Next
If the drawing is open and visible this works fine. If the drawing is open but not visible the line
Set oSheet = ThisApplication.ActiveDocument.ActivateSheet
throws an error saying the Object variable is not set.
If I just comment it out, the titleblock on the active page is deleted but when I go to the next page I get an error upon the delete.
Solved! Go to Solution.