This is usually an easy task, but now I'm not able to see what could be wrong!!!
Here is the simple code:
Dim fileName As String, path As String, ObjDWG As AcadDocument
path = "C:\Temp\geotic\Tiri\"
fileName = Dir(path & "*.dwg")
ThisDrawing.Application.Documents.Open (path & fileName)
I see that Autocad (2011) is trying to open the file up to some point, then Error -2145386153 (80200157)
I can open the file manually without any problem, note that the file I'm trying to read is from a third party software
If I save the file with autocad and try to open it with VBA... still crash.
No problem with a native drawing
A sample is attached.
I solved the problem, I have FME a software I use to translate files, (same software used by inside autocad) and it to saved all my files to DXF.
But I ran into another problem, with an another method.
fileName = fileName & ".dwg"
'fileName = path & "3D\" & fileName
ThisDrawing.SaveAs fileName, ac2007_dwg
If I try to do the saveas to a different folder it crashes... simply saveas to the default folder it works!!!???
this is why I've put a remark in front of the second line above!
Try to use:
fileName = path & "\3D\" & fileName
Not sure about thogh just a shot in the dark
Access a broad range of knowledge to help get the most out of your products and services.