Can someone help me reassign the .StyleSheet attribute of an object. When ever the
ACADLayout.StyleSheet = StrStylSheet
assignment runs, the program shuts down. I can msgbox the ACADLayout.StyleSheet and it does provide the correct default StyleSheet.
Private Sub Send_DWF()
Set ObjAcadDoc = ObjAcad.Documents.Open("file.dwg")
Set ACADLayout = ObjAcadDoc.ActiveLayout
StrStylSheet = "Black_White_Plot.ctb"
PlotConfig = "DWF eView (optimized for viewing).pc3"
msgbox ACADLayout.StyleSheet
With ACADLayout
.PlotType = acExtents
.PlotRotation = ac90degrees
.CenterPlot = True
.StandardScale = acScaleToFit
.StyleSheet = StrStylSheet ' The program dies on this line
.PlotWithPlotStyles = True
.RefreshPlotDeviceInfo
End With
ObjAcadDoc.Plot.PlotToDevice (PlotConfig)
End Sub