Exchange Forum > ActiveX and VBA
Opening a Drawing from VBA
Opening a Drawing from VBA

#1

Logan
Join Date:
08-14-2008
This seems like it should work, but it doesn't. It only opens the open drawings dialog.
I added the extra "& vbCr" hoping that it would trigger the Open button, but it's not even the correct drawing.
Any help would be appreciated.
Thanks
Code:
Sub Main()
 ThisDrawing.SendCommand "open" & vbCr & "D:\Drawings\PN12345.dwg" & vbCr & vbCr
End Sub
Opening a Drawing from VBA

#2

Russell
Join Date:
07-31-2007
Try this method over the SendCommand method, and see if it works for you.
 
Code:
Sub Main()
  ThisDrawing.Application.Documents.Open ("D:\Drawings\PN12345.dwg"), False
End Sub
Opening a Drawing from VBA

#3

Logan
Join Date:
08-14-2008
That's it. Thanks!