error handling when plotting in acad vba

Discussion in 'AutoCAD' started by sien, Apr 18, 2005.

  1. sien

    sien Guest

    Hello,

    I wrote a vba application that should create dwf files from dwg files.
    The interface has to run as a schedule task.
    The problem is that for some drawings we get a fatal error message and
    we have to click on OK button. Since that the routine is a task that
    run every night, I have to avoid this popup error.
    Is there a way to catch the error (eg. in vba with on error resume
    next) so that we can just neglect the drawing with error and go to the
    next drawing?
    Thanks a lot in advance.
     
    sien, Apr 18, 2005
    #1
  2. sien

    aryan2000 Guest

    When the error occurs is it the same error number?

    You could use something like this

    On Error Resume Next
    ' Code to open drawing
    Application.Documents.Open strFileName
    ' Test to see if drawing opens correctly
    If Err.Number=0 Then
    ' Process the drawing, etc .......


    End If

    Anthony Ryan
     
    aryan2000, May 10, 2005
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.