+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Junior Member
    Using
    not specified
    Join Date
    Feb 2006
    Posts
    15

    Default elegant way to kill script in VBA?

    Registered forum members do not see this ad.

    Is there a better way to kill a script when a cancel button is pressed other than:

    Code:
    Private Sub CancelButton_Click()
        End
    End Sub
    the reason I ask is that when you kill the script this way, AutoCAD shows"Execution error" in the command window, which is kind of ugly and not really true.

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,633

    Default Re: elegant way to kill script in VBA?

    Quote Originally Posted by sweetbrett
    Is there a better way to kill a script when a cancel button is pressed other than:

    Code:
    Private Sub CancelButton_Click()
        End
    End Sub
    the reason I ask is that when you kill the script this way, AutoCAD shows"Execution error" in the command window, which is kind of ugly and not really true.
    How about:

    Code:
    Private Sub CancelButton_Click()
        Unload Me
    End Sub
    Assuming there is no other sub running.

  3. #3
    Junior Member
    Using
    not specified
    Join Date
    Feb 2006
    Posts
    15

    Default

    Registered forum members do not see this ad.

    much nicer, thanks.

Bookmarks

Posting Permissions

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