+ Reply to Thread
Results 1 to 4 of 4

Using Cancel with On Error GoTo

  1. #1
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Using Cancel with On Error GoTo

    Greetings!
    I am wanting to use "cancel" within my macro that contains an "On Error GoTo". I would like for Sheet 68 M28 to have a 1 if the PDF has been created. A 22 if the PDF was not created due to an existing PDF with same name opened. And a 33 due to cancelling the PDF. I am using the following code, but cannot seem to get the cancel part to work.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Using Cancel with On Error GoTo

    This part:
    Please Login or Register  to view this content.
    is never executed.
    It shall be located before "proper" part. So:

    Please Login or Register  to view this content.
    PS: note added swithing back on
    Please Login or Register  to view this content.
    on all exit routes
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    07-07-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    500

    Re: Using Cancel with On Error GoTo

    Kaper,
    Thank you much!!! Works GREAT!!!

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Using Cancel with On Error GoTo

    Glad it worked, and thanks for marking thread SOLVED and for rep. point

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 02-03-2016, 12:23 PM
  2. [SOLVED] .Match with On Error: On Error Resume Next works. On Error GoTo only works once. Err.Clear
    By Doc.AElstein in forum Excel - New Users/Basics
    Replies: 28
    Last Post: 03-16-2015, 12:55 PM
  3. [SOLVED] Error Occurs while running to On Error Goto Line3
    By moinsk21 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2014, 02:37 PM
  4. Run-time error '91' when 'On error goto' and cells.find
    By bjoern in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2008, 07:27 PM
  5. [SOLVED] On Error Goto (Global Error Handling)
    By mpeplow in forum Excel General
    Replies: 3
    Last Post: 04-10-2007, 11:33 PM
  6. [SOLVED] Error Handling - On Error GoTo doesn't trap error successfully
    By David in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-16-2006, 02:10 PM
  7. Use of ON ERROR GOTO 0
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-04-2005, 04:44 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