+ Reply to Thread
Results 1 to 6 of 6

UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this?

  1. #1
    Forum Contributor
    Join Date
    10-30-2014
    Location
    Pretoria, South Africa
    MS-Off Ver
    Office 365
    Posts
    111

    UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this?

    Good Day,

    Hope you are well.

    In the past I always used this code (below) to copy the UserForm that is open to paste in documents presentations etc. However, I am not sure if this was due to the upgrade to MS Office 365 or what, but now it copies the UserForm and the MsgBox to the clipboard as per the attached picture.

    My Question is what code should I add or try to prevent the MsgBox from copying to the clipboard as well?

    I thank you in advance.

    Please Login or Register  to view this content.
    UserForm and MsgBox clipboard 1.png

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this

    Try copying the screen before you display the message box but if you really want to tell the user it has been done before doing it then possibly add a line between the 2 statement containing just
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-30-2014
    Location
    Pretoria, South Africa
    MS-Off Ver
    Office 365
    Posts
    111

    Re: UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this

    Hi there,

    Thanks for the reply, I figured out some other method as well. I put in a delay before the next code runs and it worked. Looks like this.


    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this

    That's exactly what Doevents does - it allows the Operating system to catch up with pending tasks but it still seems more logical to capture the screen before telling the user you've done it.

  5. #5
    Forum Contributor
    Join Date
    10-30-2014
    Location
    Pretoria, South Africa
    MS-Off Ver
    Office 365
    Posts
    111

    Re: UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this

    Hi there,

    Just out of interest if I copy the userform before showing the message for, then for some reason it copies my whole screen image and not just the userform. Weird, but at least my work around works now. Thanks!

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: UserForm copies to clipboard, but includes the MsgBox that pop up, how to prevent this

    Thanks for that - might have a look out of curiosity.

+ 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. [SOLVED] If msgbox yes/no selected then prevent closing userform
    By boboivan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2015, 07:59 AM
  2. display what's on the clipboard in msgbox promt
    By xlBunny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2015, 06:49 PM
  3. [SOLVED] To Print no of copies and specific page get input from msgbox in excel vba
    By barathsoft in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-05-2015, 06:09 PM
  4. Prevent clipboard from emptying with macro that runs on deactivate
    By CDEG in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2014, 08:52 AM
  5. Prevent making different copies of my excel spreadsheet
    By Renildrah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2011, 04:28 AM
  6. Formula to prevent cell copies
    By Mr.E.Bear in forum Excel General
    Replies: 2
    Last Post: 05-20-2009, 04:44 PM
  7. multiple copies from web page to clipboard
    By Shaka in forum Excel General
    Replies: 0
    Last Post: 06-14-2006, 02:50 PM

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