Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Nov 2007
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Runtime Error '462' (VBA/Excel)

    Hi,
    I have this code to open a AutoCAD File using a macro in Excel,

    Dim OleObj As Object
    SW_SHOWNORMAL = 0
    getDoc = ShellExecute(hwnd, "open", "Drawing.dwg", "", "CesignCars", SW_SHOWNORMAL)

    The problem is when i use the marco, the drawing pops up fine.
    but when i close it and use the macro again. It came out with an error "462"
    Please Advise
    Thank you

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Runtime Error '462' (VBA/Excel)

    Do you manipulate the AutoCad file in code after opening it?

  3. #3
    Lounger
    Join Date
    Nov 2007
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime Error '462' (VBA/Excel)

    No, I was testing the codes.
    so i open the file and close it. then i open again
    the runtime error pops up
    thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Runtime Error '462' (VBA/Excel)

    Can you check in the Processes tab of Task Manager whether AutoCAD remains in memory after you close the file?

  5. #5
    Lounger
    Join Date
    Nov 2007
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Runtime Error '462' (VBA/Excel)

    Hi Hans,
    I checked the Task Manager,
    On the Task Manager, Autocad goes off as i closed it.
    but when i use the macro again. The Runtime Error is still there

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Runtime Error '462' (VBA/Excel)

    This newsgroup thread describes the same problem using a different approach, perhaps you can use that with the solution provided there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •