Results 1 to 4 of 4

"Cancel" (in generic Excel dialogue box) throws VBA error

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-06-2018
    Location
    Virginia
    MS-Off Ver
    2019
    Posts
    367

    "Cancel" (in generic Excel dialogue box) throws VBA error

    Experts:

    I need some assistance with and IF/ELSE statement that's executed when pressing either "Ok" or "Cancel" on a standard Excel pop-up form.

    Once you open the attached XLSM, do the following:

    1. Click on command button "Save and Email".
    2. Now, everything works great if I enter a value into the dialogue box and click "Ok".
    3. However, if I click on the "Save and Email" and -- for whatever reason -- click "Cancel", I get a VBA error.

    How can I modify the existing VBA so that I either a) don't get the error or b) "do nothing" and not get error either? That is, if I click "Cancel", I simply should be returned to the worksheet.

    Thank you,
    Tom
    Attached Images Attached Images
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 01-09-2019, 02:15 PM
  2. VBA to click the "Open" or "Save" button in Internet Explorer Dialogue Box
    By kimvyp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-09-2019, 12:22 AM
  3. Several Macros run from VBsccript, 1 throws compile error " Excpected End With"
    By PushT in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2018, 02:10 PM
  4. Replies: 1
    Last Post: 10-10-2016, 10:14 AM
  5. [SOLVED] Insert Row throws error "Insert Method of Range class failed"
    By bg_enigma1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-09-2015, 11:30 AM
  6. Replies: 0
    Last Post: 01-04-2006, 06:55 PM
  7. [SOLVED] Is there a "generic" Error Handling method
    By Brad K. in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2005, 01:06 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1