+ Reply to Thread
Results 1 to 9 of 9

Command Button Not Working Anymore

  1. #1
    Registered User
    Join Date
    03-19-2015
    Location
    Newcastle, England
    MS-Off Ver
    365
    Posts
    33

    Command Button Not Working Anymore

    Good Morning,

    I have the attached spreadsheet which I use for recording purchase orders I raise. The command button that copies the job number to the clipboard has stopped working.

    The only difference is that my work laptop was upgraded and I'm now using Windows 11, and the office 365 has been upgraded to 64-bit rather than the 32-bit I used to use.

    Any help would be greatly appreciated. I have removed personal data from the workbook.

    Thanks
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-19-2015
    Location
    Newcastle, England
    MS-Off Ver
    365
    Posts
    33

    Re: Command Button Not Working Anymore

    I maybe haven't explained the issue very well, the button still appears to work when it's copying the job number. The problem is more when I try to paste into another program the charactors haven't copied properly and it comes out as unrecognised charactors

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Command Button Not Working Anymore

    If you're getting two boxes appear instead of the correct text, it's a bug in the MSForms DataObject that you are using for the copying (it happens if you have a File Explorer window open anywhere). You should use either API calls or something like:

    Please Login or Register  to view this content.
    Rory

  4. #4
    Registered User
    Join Date
    03-19-2015
    Location
    Newcastle, England
    MS-Off Ver
    365
    Posts
    33

    Re: Command Button Not Working Anymore

    Thanks for the reply rorya.

    That didn't work, unless I'm doing something wrong (which is highly likely!)
    Compile error.png

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Command Button Not Working Anymore

    Yes, you did something wrong.

    Just paste that function in as it is, outside any existing routines. Then wherever you need to put text on the clipboard, you can just use:

    Please Login or Register  to view this content.
    for example.

  6. #6
    Registered User
    Join Date
    03-19-2015
    Location
    Newcastle, England
    MS-Off Ver
    365
    Posts
    33

    Re: Command Button Not Working Anymore

    Not sure I'm getting what you mean Rory.

    I have included the code as you suggested. Was I supposed to be leaving the previous code in too?

    This is what it looks like now:
    Compile error.png

    I want to keep the button, the whole point of it is to copy the job number to left of the button, and there are multiple buttons on the sheet.

  7. #7
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Command Button Not Working Anymore

    Posting pictures of your code really isn't that helpful.

    Change the first routine to:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    03-19-2015
    Location
    Newcastle, England
    MS-Off Ver
    365
    Posts
    33

    Re: Command Button Not Working Anymore

    That worked, thanks so much for your help Rory

  9. #9
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Command Button Not Working Anymore

    Glad we could help, and thanks for the rep.

+ 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. Why VBA command button is not working ?
    By Sally_A in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2022, 07:20 AM
  2. Command Button not working
    By Stvone in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-20-2017, 05:20 PM
  3. VBA Command Button not working
    By CherryPie1544 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2017, 07:49 PM
  4. Macro - Reset button not working anymore
    By heather1209 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2011, 06:05 AM
  5. Command button code not working
    By mariposa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-06-2011, 05:03 AM
  6. Command button is not working by using VBA
    By Webtekr in forum Outlook Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2009, 02:22 AM
  7. command button isn't working
    By Nydia in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-29-2005, 06:06 PM

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