Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exception Error

Status
Not open for further replies.

zimGirl

Geotechnical
Jul 22, 2004
30
Hey, I am Stumped!
I created a templates with drawing limits that I use with many of my drawings.
I have several VBA codes that I run ( From menus and or Buttons) on different
data to display on these templates. One macro is causing AutoCAD to crush every
time with the error:
Exception Occurred 0xc0000005(Access Violation).
However, if I open the macro in VBAIDE with the same templates it run properly.

I can also run the same macro on a blank acad.dwt template with no problems.
These seems to be no pattern to the crashes. Sometimes it does, sometimes it does not.
Please help, I do not know what to do? Is there someway to fix this?
 
Replies continue below

Recommended for you

Hello ZimGirl,

Couple of questions - What version of VBA and ACAD are you using? Currently, there is no documentation from Autodesk on VBA.NET that indicates there are a one-to-one correspendence on which version of ACAD is compatable! I don't know when Autodesk will clear up this fog. Hope this helps - John
 
I am using AutoCAD 2002/AutoDsk Map 6.

I seem to have found the error that is causing it to tank! I keep getting an "Automation error(440) The object involved has disconected from its client" when it gets to setting the point mode and size
ThisDrawing.SetVariable "PDMODE", 98
ThisDrawing.SetVariable "PDSIZE", 4
I moved this around to the start of the code to draw and it seems to be woring well now.

Would anyone know by chance why this was happening so that next time I have a clue what to do? :)
 
It will depend on what is happening in between the beginning and end of your code. Do you at some point switch active drawing sheets in your code?

"Everybody is ignorant, only on different subjects." — Will Rogers
 
hey,
No I don't switch active drawing sheets in the code. All drawing is done in Modelspace.
I figured out that the disconnection occurred as the drawing and the point setting were in different places.
The code in the click_event calls a sub the draws the point. Within this event, after the draw sub, was the point setting. This is the point the automation error occurred and then everything would crush creating an Exception error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor