+ Reply to Thread
Results 1 to 2 of 2

Assign Macro to Button

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    Apex, NC, USA
    MS-Off Ver
    Office 365
    Posts
    64

    Assign Macro to Button

    I am using Excel 2003 on Vista. I have a custom button on a tool bar. I have assigned a macro to it that is in the Personal.xls workbook. It was working fine. From another workbook with the tool bar visible, I clicked the button and the macro executed. All was fine. At one point for some unknown reason, the button no longer activates the macro. When I try to redo the assign macro to the button, the macro is listed in the list (as being in the Personal.xls workbook). I click to select it. The macro name is then listed at the top of the Assign Macro dialog box (as normal) . I click ok to exit. However, when I subsequently click the button with the newly (re)assigned macro, the macro does not run and the assign macro dialog box displays presumable asking me to assign a macro to the button. The assignment that I did apparently didn't take. Why? If I do the (re)assignment and then just go back to the assign macro dialog, it's not there either. Other facts: While I do the assign the Personal.xls workbook is open and unhidden. The assign was working at one point and suddenly is not. The module that the macro is in contains multiple subs and functions. I have checked that they all have matching end statements. The module is in development/debug so it is reasonable to believe I have something in the macro/module that is a cause. Although, the macro is successfully listed in the list of macro's to choose from in the assign macro dialog. I have also tried deleting the button from the tool bar and recreating it. That didn't help. The macro runs successfully in debug mode where I click F5 in the VBA editor.

    Help please!
    Last edited by DanBlum; 02-22-2012 at 05:20 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    12-16-2004
    Location
    Canada, Quebec
    Posts
    363

    Re: Assign Macro to Button

    Hi

    Have a look at this maybe it will help
    Please Login or Register  to view this content.
    Denis

    Please always attach the sample workbook without sensitive information when asking for help

    To add a module
    Press Alt + F11 (this is the Visual Basic Environment)
    Insert Menu, select Module
    Past code there
    Close Visual Basic Environment (X)

+ 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