Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB Run-time error '438': in Solidworks

Status
Not open for further replies.

ffrreedd

Structural
Joined
Jan 23, 2006
Messages
9
Location
GB
If I try to use the solidworks / visual basic command:
retval = Sheet.GetProperties ()
I get the following error:
Run-time error '438':
Object doesn't support this property or method.

Any suggestions would be much appreciated.
 
I'll bet you are not using the Sheet object properly. How did you obtain the Sheet object? Stick this code in a macro and run it while a drawing is open. It will echo back the drawing scale of the active sheet.
Code:
Option Explicit

Dim swApp As Object
Dim Part As Object
Dim Sheet As Object
Dim retval

Sub main()

    Set swApp = CreateObject("SldWorks.Application")
    Set Part = swApp.ActiveDoc
    
    Set Sheet = Part.GetCurrentSheet
    
    retval = Sheet.GetProperties
    MsgBox "Scale = " & retval(2) & ":" & retval(3)

    Set Sheet = Nothing
    Set Part = Nothing
    Set swApp = Nothing
End Sub
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
 
That fixed it, thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top