×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Exception Error

Exception Error

Exception Error

(OP)
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?

RE: Exception Error

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

RE: Exception Error

(OP)
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? :)

RE: Exception Error

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

RE: Exception Error

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources