AnsweredAssumed Answered

Fullscale Macro broken in 2014

Question asked by Bartosz Korec on Jul 3, 2014
Latest reply on Jul 9, 2014 by Deepak Gupta

Hi there,

finally got around to setting up my 2014 version of SW, and I get an error when using the fullscale macro that has been working fine up until now.

The error is " Run-time error 91: Object variable or With block variable not set"

 

The macro is:

 

Option Explicit

 

 

 

 

Dim swApp As Object

Dim modelDoc As Object

Dim modelView As Object

Sub main()

Set swApp = CreateObject("SldWorks.Application")

Set modelDoc = swApp.ActiveDoc

Set modelView = modelDoc.ActiveView

modelView.Scale2 = 0.763

modelDoc.GraphicsRedraw2

End Sub

 

The problem seems to be with "Set modelView = modelDoc.ActiveView"

 

Can anyone help me fixing this?  Big fan of this macro.

Outcomes