Excel VBA - Goalseek in draft environment

Experimenter
Experimenter

Hi,

 

I'm struggling to run a goalseek via VBA. The funcion is on SolidEdgeDraft.DraftDocument but still I have no success running it.

I get the error message 438 "Object doesn't support this property or method."

 

Dim objApp As SolidEdgeFramework.Application

Call objApp.Goalseek("V2882", "V2485", 70 / 1000, 60, 300)

 

Any hints on this?

Thanks

image.png

1 REPLY

Re: Excel VBA - Goalseek in draft environment

Experimenter
Experimenter

I could get this sorted out, only mistakes on the syntax. the simplest code that works would be:

 

Sub Goalseek()
    
    Dim objApp As SolidEdgeFramework.Application
    Dim objDraft As SolidEdgeDraft.DraftDocument
    
    Set objApp = GetObject(, "SolidEdge.Application")    
    Set objDraft = objApp.ActiveDocument
    
    Dim dblTime As Double, lngNumInt As Long, blnTimelimit As Boolean, blnIntLimit As Boolean
    
    Call objDraft.Goalseek("V2882", "V2485", 100 / 1000, 60, 300, dblTime, lngNumInt, blnTimelimit, blnIntLimit)    
    
End Sub

Thanks!