AnsweredAssumed Answered

Macro stopped working in SW 2012 but not 2014 ?

Question asked by James Kashuba on Feb 19, 2015
Latest reply on Feb 20, 2015 by Deepak Gupta

Good morning Guys and Gals,

I recently installed 2014 in addition to 2012 on the same machine. Everything seems to be working ok but now I have this macro issue. Other macros don't seem to be affected, only this one. To the best of my knowledge everything looks good in the code. I've used it thousands of times in 2012 with no problems until I installed 2014. It works in 2014 but no longer in 2012. Any ideas? Here's the code:

 

Dim swApp As Object

 

Dim Part As Object

Dim boolstatus As Boolean

Dim longstatus As Long, longwarnings As Long

 

Sub main()

 

Set swApp = CreateObject("SldWorks.Application")

Set Part = swApp.ActiveDoc

 

Dim MyProp(1, 9) As String

 

'Property names

MyProp(0, 0) = "Configured"

MyProp(0, 1) = "Revision"

MyProp(0, 2) = "Description"

MyProp(0, 3) = "Material"

MyProp(0, 4) = "Finish"

MyProp(0, 5) = "Drawing Number"

MyProp(0, 6) = "Part Number"

MyProp(0, 7) = "Supplier Part Number"

MyProp(0, 8) = "Reference Information"

MyProp(0, 9) = "Project Name"

 

'Property values

 

MyProp(1, 0) = "No"

MyProp(1, 1) = "A"

MyProp(1, 2) = ""

MyProp(1, 3) = ""

MyProp(1, 4) = ""

MyProp(1, 5) = "$PRP:" + Chr(34) & "SW-File Name" & Chr(34)

MyProp(1, 6) = ""

MyProp(1, 7) = ""

MyProp(1, 8) = ""

MyProp(1, 9) = ""

 

Dim m As Integer

 

For m = 0 To 9

    retval = Part.AddCustomInfo3("", MyProp(0, m), 30, _

         MyProp(1, m))

Next m

 

End Sub

Outcomes