Hi Everyone,
Im an api newbie please add your advice if you can.
What is wrong with the following code?
I get a "missing object" error
Oh and another Q - what does the debug.print do?
Thanks Ron.
' ****************************************************************************** ' C:\DOCUME~1\ron\LOCALS~1\Temp\swx3112\Macro1.swb - macro recorded on 03/05/09 by ron ' ****************************************************************************** Dim swApp As Object Dim Part As Object Dim SelMgr As Object Dim boolstatus As Boolean Dim longstatus As Long, longwarnings As Long Dim Feature As Object Dim drpath As String Dim StrFileok As BooleanDim nretval As Long
Sub main() StrFileok = True Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc
drpath = Part.GetPathName drpath = Left(drpath, Len(drpath) - 6) drpath = drpath + "pdf" StrFileok = swModel.SaveAs4(drpath, swSaveAsCurrentVersion, swSaveAsOptions_Silent, nErrors, nWarnings) If StrFileok = False Then nretval = swApp.SendMsgToUser2("Problems saving file.", swMbWarning, swMbOk) End If
End Sub