+ Reply to Thread
Results 1 to 4 of 4

Macro buttons no longer working unless file opened and closed first.

  1. #1
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Macro buttons no longer working unless file opened and closed first.

    Hi, thanks for looking.

    I have a numerous Workbooks created from the same template with several macros, in modules and on the worksheets. I have used these files, multiple times a day since January with no problems, now all of a sudden the macro buttons no longer work unless I open/close and reopen the workbook, i get the error 'Cannot run the macro "Filename!Macro name'. The macro may not be available in this workbook or all macros may be disabled'. The macro buttons run macros that are only stored in modules.

    This has really stumped me, as why would it not work and then work if reopened, although this method doesnt work on all the workbooks, some wont work at all no matter how many times I reopen them, and the workbooks have all been created from the same template and used in exactly the same way.

    Whats weirder is that I have started creating a new template for 2022, by modyfying the old template, and this does not produce the error at all, even though the macros stored in it, that are run from the buttons have not changed.

    The error started approx a month ago around the same time I started creating the new template so I was wondering if perhaps there has been some kind of update effecting the old workbook but not a newly created one but I am clutching at straws now.

    I am using form buttons and not command buttons and I have been in the trust centre and tried running all the different options for macro settings but none have worked.

    Any help anyone can offer would be appreciated.
    Last edited by Funkymonkey0073; 11-19-2021 at 06:09 AM. Reason: added more detail

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Macro buttons no longer working unless file opened and closed first.

    Without a workbook to test we're not able to do much more than guess and offer theoretical options. The error you quote could be due to the reference to the sheet being lost and the macro therefore being not found. If you post a file with some sample data I'll take a look.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  3. #3
    Forum Contributor
    Join Date
    03-19-2019
    Location
    Essex, England
    MS-Off Ver
    Office 365
    Posts
    110

    Re: Macro buttons no longer working unless file opened and closed first.

    Thanks MatrixMan, I have attached the workbook, I've renamed the modules that relate to the buttons to make it a little easier for you. Any help would be appreciated, I've done my research but found nothing that helps.

    Stuart
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862

    Re: Macro buttons no longer working unless file opened and closed first.

    I don't see anything that copies a worksheet intact (so the macros get copied too) to another workbook - where is the code that does that?

+ 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] Command buttons no longer working
    By Dragondude in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-26-2019, 07:06 PM
  2. Created macro not showing up after the file is closed and re-opened
    By B24Mike in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2015, 03:28 PM
  3. [SOLVED] How to see time between file opened and file closed?
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-24-2015, 08:06 AM
  4. [SOLVED] Buttons No Longer Working
    By SHUTTEHFACE in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-15-2014, 05:26 PM
  5. User added buttons no longer working
    By capt_tony in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-11-2013, 11:42 AM
  6. [SOLVED] macro not working properly until vb editor is opened and closed again
    By freddiethomas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-14-2012, 03:58 AM
  7. Macro to open/close a file only if it isn't already opened/closed
    By catccc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-24-2010, 10:27 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