VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Autocad 2013 windows 7 64 bit with MS Access

3 REPLIES 3
Reply
Message 1 of 4
sanganaksakha
588 Views, 3 Replies

Autocad 2013 windows 7 64 bit with MS Access

I have a VBA batch macro that is causing a problem. Here is what the macro does:

 

1. Displays a form that allows the user to select a folder.

2. Populates a list box on the form with all drawings in the selected folder.

3. In batch mode:

3.1 Opens a drawing listd in the list box.

3.2 Collect valies of all attributes and stotr them in variables.

3.3 save the drawing (as AM2008) on the server.

3.4 Delete the drawing from the ptiginal location.

3.5 Write attribute data to MS Access 2007 database (located on Server).

3.6 Go back to step 3.1 until all drawings are processed.

 

I get the following error after exactly 3 drawings are processed.

 

Runtime error-2147417856 (80010100) Automation Error

System Call Failed.

 

The code that causes this error is: 

 

Set dwgToProcess = acadApp.Documents.Open(lstFiles.List(i), True)

 

How can I overcome this this error?

3 REPLIES 3
Message 2 of 4

Hi,

 

I would first verify if the drawings, that were already processed, are closed ... or do they stay open?

The second verification would be to change the dawings, so you use other drawings and not always the same ones.

 

Some info's missing:

>> I have a VBA batch macro

Is that running in AutoCAD-VBA or in Access-VBA?

 

>> I get the following error after exactly 3 drawings

Is that error exactly equal for every test, even for different drawings?


It would be great if you can reduce your code to the minimum and upload it here, just as few code necessary to get the problem reproducable (e.g. is it enough to open your drawings, then save and close them to see the same issue?)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 4

Alfred,

 

Thanks for the response.

 

1. I have verified that the drawing does get closed. In fact the whole prcess is successfully performed on all the three drawings.

 

2. I have done testing with different sets of randomly selected drawings with the same results. Multiple users are facing exactly the same problem.

 

3. The VBA macro is run inside AutoCAD.

 

4. Yes, that error exactly equal for every test, even for different drawings. (In one or two cases I got it after 4 or even 2 drawings)


5. I have tested It with only open drawings, then save and close. It does not seem to have problem.

 

I am perplexed by the fact that it generates error exactly after 3 deawings.

Message 4 of 4

Hi,

 

will be difficult for us without seeing the code, something is not cleaned up then.

I would modify my code now by reducing the process of whatever happens with the drawing (back to just open - save - close) and see what part of your handling within the drawing makes it crashing or succeeding.

 

Good luck, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost