+ Reply to Thread
Results 1 to 3 of 3

Form control button not retaining assigned macro name

  1. #1
    Registered User
    Join Date
    07-12-2013
    Location
    honolulu, HI
    MS-Off Ver
    Excel 2013
    Posts
    7

    Form control button not retaining assigned macro name

    I'm using Excel 2013 and new to VBA. I created a macro that served it's purpose with no errors. I then created a form control button and assigned the macro. tested it, worked great with no issues. Then I did two things before realizing the button is no longer working. 1st I used this code

    Please Login or Register  to view this content.
    on sheet1 and tested it. It worked with 1 issue, if the tab name already exists. I was going to add a line to handle the error but had other items to attend to first.

    then I renamed the module containing the macro used for the form control button.

    Now when I click on the button I get this: "Cannot run the macro "template V5.xlsm'!Copy Sheet Data to Closing RPD". The macro my not be available in this workbook or all macros may be disabled.

    "template V5" is the workbook name and the macro is called "Copy_Paste_specal_Values"

    "Copy sheet data to closing RPD" is the caption in the button.

    Please help me understand how I managed to break everything in this workbook and if I can fix it.

    Thank you for taking the time to read my issue. This is my first post on this forum.

    How I solved it:

    I am still unaware of the specific cause, however deleting all of the form control buttons, (I had 1 per sheet), creating new ones and creating a macro for each as opposed to my previous method, which was using the same macro on every button running this code

    Please Login or Register  to view this content.
    Now I have that code (31) times. 1 for each day of the month, with the sheet name added at the end for each. again I don't know what caused this which was half the reason for this post. If anyone else runs into this issue, please post the circumstances here.
    I'm sure if this code above were more efficient, then I would not have run into the error mentioned at the beginning of the post.
    Last edited by sinistr0311; 07-18-2013 at 01:02 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,963

    Re: Form control button not retaining assigned macro name

    Did you right-click the button and select assign macro, choosing from the list?
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    07-12-2013
    Location
    honolulu, HI
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Form control button not retaining assigned macro name

    yes, the button was working for over a day. then I attempted the changes I mentioned and now it gives me the error.

+ 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. Creating a macro and form control button
    By kaye.roberts393 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2013, 02:13 PM
  2. Macro-Button (form Control)
    By mjali001 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-16-2013, 09:52 PM
  3. problem a macro with form control button
    By initialcondition in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2011, 01:09 PM
  4. Assigned Macro to Combo Box(Form Control)
    By pantus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2009, 04:43 PM
  5. macro assigned to a form control button in a protected worksheet
    By lee_har in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2009, 02:29 AM

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