This is a macro that I found in the news group, but I get an error when I try and run it "type mismatch" any ideas why and what can be changed to solve it?
it happens at "sMsg = "Enter the Path to the Drawings." & vbCrLf * "Make sure to end it with a \""
Thanks for any help
Dim swApp As SldWorks.SldWorks Dim swPart As ModelDoc2 Dim swDwg As DrawingDoc
Const swDocDrawing = 3
Sub main() Dim sPath As String Dim sFileSW As String Dim sFileDWG As String Dim sFileTitle As String Dim sMsg As String sMsg = "Enter the Path to the Drawings." & vbCrLf * "Make sure to end it with a \" sPath = InputBox(sMsg, "Enter Drawing Path", "C:\Temp\") If sPath = "" Then Exit Sub Set swApp = CreateObject("SldWorks.Application") sFileSW = Dir(sPath & "*.slddrw") Do While sFileSW "" 'Open Drawing - Define Titles Set swPart = swApp.OpenDoc(sPath & sFileSW, swDocDrawing) Set swDwg = swPart 'Save As DWG sFileDWG = Left(sFileSW, Len(sFileSW) - 6) & "DWG" swPart.SaveAs2 sPath & sFileDWG, 0, True, False 'Close File sFileTitle = swPart.GetTitle swApp.CloseDoc sFileTitle 'Next File sFileSW = Dir Loop swApp.SendMsgToUser "Done!" End Sub