+ Reply to Thread
Results 1 to 12 of 12

End Sub when "cancel" is hit

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Question End Sub when "cancel" is hit

    i wrote a macro to open a local video file

    but excel always pop out a warning message window saying"...may contain virus...would you like to open this file"

    if i click ok, it properly opens the video, but when i click cancel, it mess up and i got a runtime error, is there a way to end sub when cancel is clicked?

  2. #2
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    Do you want to see the warning message at all? If not then put this in your code
    Please Login or Register  to view this content.
    Regards,
    amotto

    If I helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: End Sub when "cancel" is hit

    Thank you so much, but after adding these 4 lines, the message window still pop up ..somehow

  4. #4
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    Is this a message that excel is popping up or an error your creating?

  5. #5
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    Could you post your code by any chance with my suggestion because I am pretty sure your answer to my last question

  6. #6
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: End Sub when "cancel" is hit

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    Try this

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: End Sub when "cancel" is hit

    wow it works!!!! thank you so much!

  9. #9
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    Your welcome, glad we could get it.

  10. #10
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    if you want to try this, let me know how it goes instead of my error handling try this

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    01-22-2013
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: End Sub when "cancel" is hit

    thank you for trying different ways to solve this, but the new code does not work, still gets into runtime after cancel

  12. #12
    Forum Contributor
    Join Date
    08-22-2011
    Location
    Texas, United States
    MS-Off Ver
    Excel 2007 and 2010
    Posts
    516

    Re: End Sub when "cancel" is hit

    dang okay, there has got to be an application that makes that box not pop up i just cannot think of it right now. oh well at least we solved it one way

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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