This content has been marked as final. Show 2 replies
Good start Damian. Try these codes
Option Explicit Sub main() Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim swDraw As SldWorks.DrawingDoc Dim vSheetName As Variant Dim i As Long Set swApp = Application.SldWorks Set swModel = swApp.ActiveDoc Set swDraw = swModel vSheetName = swDraw.GetSheetNames For i = 0 To UBound(vSheetName) If vSheetName(i) = "DXF Sheet" Then swDraw.ActivateSheet vSheetName(i) swDraw.GetCurrentSheet.SheetFormatVisible = False End If Next i swDraw.ActivateSheet (vSheetName(0)) End Sub
The issue with your codes is that you're setting SwSheet as the current active sheet (before looping and find the DXF sheet). And hence macro is hiding that sheet's format
Thanks Deepak. All makes sense now.