I'm using VBA to change property fields in a drawing. I just upgraded my computer which is now running Office 2013 and my code doesn't work anymore. I get an error message of "Compile error: Can't find project or library" when I try to execute the following code. Additionally, the text "swCustomInfoText" is highlighted by the debugging program.
Sub ChangeProperties()
Dim swApp, Part As Object
Dim boolstatus, retval As Boolean
Dim swModel As SldWorks.ModelDoc2
Set swApp = CreateObject("sldworks.application")
swApp.Visible = True
FilePath = DirectoryPath & "\" & DrawingFileName
swApp.OpenDoc FilePath, 3
Set Part = swApp.ActiveDoc
retval = Part.DeleteCustomInfo2("", "DrawnDate")
retval = Part.AddCustomInfo3("Default", "DrawnDate", swCustomInfoText, VBA.Format(VBA.Date, "m/d/yy"))
boolstatus = Part.EditRebuild3()
End Sub
Sounds like some of your SW references are missing. See if your macro is referencing SOLIDWORKS (version) Constant type library.