Page 1 of 2 12 LastLast
Results 1 to 10 of 17

VBasic - command buttons stopped working

This is a discussion on VBasic - command buttons stopped working within the Excel Questions forums, part of the Question Forums category; I have a Mastermind game sheet that uses many command buttons. After several YEARS(!), it suddenly stopped working. I'm using ...

  1. #1
    New Member
    Join Date
    Jun 2013
    Posts
    10

    Default VBasic - command buttons stopped working

    I have a Mastermind game sheet that uses many command buttons. After several YEARS(!), it suddenly stopped working.
    I'm using Excel 2010 at the office but the workbook is saved as Excel 97-2003 for compatibility with my home PC (this has worked fine for years).
    The buttons are all enabled and are seen to respond, but none of them work - the code just doesn't run.
    I have tried disabling subroutines one at a time, by converting each line to a comment.
    I tried adding a new command button to do a simple task but the new button also fails to do anything.

    Any ideas?

  2. #2
    Board Regular
    Join Date
    Jun 2016
    Posts
    80

    Default Re: VBasic - command buttons stopped working

    Have you checked if the assigned macros in the buttons are still there?

  3. #3
    MrExcel MVP mikerickson's Avatar
    Join Date
    Jan 2007
    Location
    Davis CA
    Posts
    20,935

    Default Re: VBasic - command buttons stopped working

    Are you sure that Macros are enabled?

  4. #4
    New Member
    Join Date
    Jun 2013
    Posts
    10

    Default Re: VBasic - command buttons stopped working

    Quote Originally Posted by manu197a View Post
    Have you checked if the assigned macros in the buttons are still there?
    Yes, all the code is intact.

  5. #5
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    29,370

    Default Re: VBasic - command buttons stopped working

    Are they activeX buttons or Form buttons?

  6. #6
    New Member
    Join Date
    Jun 2013
    Posts
    10

    Default Re: VBasic - command buttons stopped working

    I've looked through all the 'File > Options > Trust Center' settings and can't find anything that's turned off but looks like it should be on (or vice versa).

  7. #7
    New Member
    Join Date
    Jun 2013
    Posts
    10

    Default Re: VBasic - command buttons stopped working

    Quote Originally Posted by RoryA View Post
    Are they activeX buttons or Form buttons?
    I've read about ActiveX but I'm afraid I was brought up on Spectrum Basic and assembler and don't really understand what it actually means (doh!).
    In case this helps you:

    I always start off writing code by firstly using the 'Command Button (ActiveX Control)' button to create each command button on the sheet.
    In Design mode, I then right-click and select 'View Code' to get:

    Private Sub CommandButton1_Click()

    End Sub

    This method has always worked well for me.

  8. #8
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    29,370

    Default Re: VBasic - command buttons stopped working

    Quote Originally Posted by RogerThePerson View Post
    I always start off writing code by firstly using the 'Command Button (ActiveX Control)' button to create each command button on the sheet.
    There's your answer.

    Can you try using a form button and assigning a macro to it instead? If that works, I suspect you're running into yet another activeX update issue. (See here for example: Office Update breaks ActiveX controls | Excel Matters)

  9. #9
    New Member
    Join Date
    Jun 2013
    Posts
    10

    Default Re: VBasic - command buttons stopped working

    Quote Originally Posted by RoryA View Post
    There's your answer.
    Can you try using a form button and assigning a macro to it instead? If that works, I suspect you're running into yet another activeX update issue. (See here for example: Office Update breaks ActiveX controls | Excel Matters)
    Good suggestion - thanks - but I remember this ActiveX bug arising a long while back. Our IT dept circulated the fix instructions (removal of *.exd files) and all was well. This problem is new, and affects only THIS workbook.
    Maybe the problem is much simpler - maybe there is another setting that I've overlooked which disables macros ONLY in this workbook?

  10. #10
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    29,370

    Default Re: VBasic - command buttons stopped working

    Macro security settings are application wide, but it is possible you disabled macros for that workbook when you opened it. Can you run any of the code manually from the VB Editor?

Page 1 of 2 12 LastLast

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com