AcadApplication.documents.open execution error on 64 bits only

AcadApplication.documents.open execution error on 64 bits only

andre_adc-dao
Advocate Advocate
1,974 Views
11 Replies
Message 1 of 12

AcadApplication.documents.open execution error on 64 bits only

andre_adc-dao
Advocate
Advocate

HI,

 

I use AcadApplication.Documents.open to open drawings. It works well on 32 bits (XP or Vista) but failed in 64 bits (Windows 7). I had the same problem with AutoCAD 2010, 2011 or 2012. Anybody have a workaround to open documents in this context?

 

Regards,

 

André

0 Likes
1,975 Views
11 Replies
Replies (11)
Message 2 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> [...] but failed [...]

And you had an exception? Then let us know this please 😉

Or how do we have the imagine what type of "failed" you saw?

Have you updated the AutoCAD-specific references?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 12

andre_adc-dao
Advocate
Advocate

Sorry,

 

But I have a French AutoCAD so I tried to translate the error message. In French it say  "Erreur d'exécution" maybe it is runtime error in English.

 

Regards,

 

André

 

0 Likes
Message 4 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

Have you updated the AutoCAD-specific references within your DVB-project (clean out the old one, close, reopen, add the new references)?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 12

andre_adc-dao
Advocate
Advocate

Hi Alfred,

 

I did that. On 32 bits machine it goes well but not on 64 bits machine. It is probably related to that bacause I know that sometimes VBA doesn't work well on 64 bits OS. But maybe I can find a workaround. Rewrite the code with VB .Net is a lot of work.

 

Thanks,

 

André

0 Likes
Message 6 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> it say  "Erreur d'exécution" maybe it is runtime error in English

Does it stop at the code by open VBAIDE and showing the line where the error occurs? If so can you show the code-snippet and specify the line + the error number that occurs?

 

>> Rewrite the code with VB .Net is a lot of work.

Yes and no. On one side you can live with VBA as long as you don't update AutoCAD, but the time comes (don't know when, of course) where VBA will be discontinued.

ON the other side with VB.NET you have much more options to expand your app-functionality. An additional way for making the porting of the code more efficient could be to do it either with a training (check a trainer who knows VB.NET + AutoCAD and make parts of porting with training days) or let some professional do the porting. For that you have to compare your time-cost you'll need for porting with the costs some professional uses.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 12

andre_adc-dao
Advocate
Advocate

HI,

 

I attached the error message in a doc file. I've also include the line of code where is the error.

 

Thanks,

 

André

0 Likes
Message 8 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Where gvDWGList(i) contains a name of a drawing

What's the name of the file stored in gvDWGList(i) at the time the code crashes? Did you try to use this name then and open it manually?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 9 of 12

andre_adc-dao
Advocate
Advocate

HI,

 

The filename is ok (J:\XXXXXX\DIana\Products\VOR_0103_XXX_BUCKETTRIO.dwg), I can open it without problem on the 64 bits machine (AutoCAD 12). When I run the same code on a 32 bits machine, everything run fine.

 

I also try the filename with or without extension with no difference.

 

Thanks,

 

André

0 Likes
Message 10 of 12

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

could you reprodoce the exception also by creating a test.dvb with a sub that opens just this (or another) file?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 11 of 12

andre_adc-dao
Advocate
Advocate

Hi,

 

Good idea, I will try that.

 

Thanks,

 

André

 

0 Likes
Message 12 of 12

andre_adc-dao
Advocate
Advocate

Hi Alfred,

 

I didn't have to time to create a test routine but I replace AcadApplication.Documents.Open by Thisdrawings.Documents.Open and the error disappears. I usually preferred the previous call because I can have a problem if no document is actually open, but in this case it doesn't matter.

 

The macro work without error (but much slower) except when I want to insert a block from another drawing using ObjectDBX.

 

Dim DbxDoc As AxDbDocument

...

Set DbxDoc = GetInterfaceObject("ObjectDBX.AxDbDocument.18")

 

DbxDoc is set to nothing.

 

I tried different methods with no success. Now I will try to write only this function in .Net. I will let you know if I succeed.

 

 

Regards,

 

André

0 Likes