I am new to macros and am looking for a little help getting a macro to work the way I want it to. I am using an input box for the user to input the sketch number that contains a named dimension I want to use in the equation. I am able to get all of the variables to show up the way I want in the code but do not know how to get them to write into the equation list in my part when I am using the variables. If I hard code the sketch names they write into the equation list fine. I am thinking I do not have the variables called out properly...
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID2("Equations", "EQNFOLDER", 0, 0, 0, False, 0, Nothing, 0)
Dim nmbText As String
nmbText = InputBox("Specify The Sketch Number") 'user enters sketch number with the named dimensions in it
Dim nmb As Integer
Dim wnText As String
Dim lnText As String
Dim WText As String
Dim LText As String
Dim swEquationMgr As Object
Set swEquationMgr = Part.GetEquationMgr()
'the follwing does not work attempting to use variables to make the equation
swEquationMgr.Add -1, """SquareFeet""= wn * nmb / 144"
boolstatus = Part.ForceRebuild()