Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long-established database suddenly giving error Cannot open macro [Name] because it is not valid

Status
Not open for further replies.

TheresAlwaysAWay

Programmer
Mar 15, 2016
135
US
This DB has been up and running since 2010. I have relied fairly heavily on macros in its development. I know that the coders see them as being somehow an inferior way of getting the job done, and maybe they are, but they are also a valid part of the toolbox that Microsoft designed and continues to provide. I have simply used what they offered more frequently than many others have.

Regardless, the DB started life as 2007 version and it has been migrated (refuse to use the word 'upgraded') to 2016.

The migration was done more than a year ago, but just in the last day or so these errors have been popping up in many places.

I ran the "Compact and Repair" routine on the DB itself (no help), and then I ran a decompile/recompile operation with the same negative results.

I'm at a complete loss because this DB has been established for such a long time and the errors are all over the map functionally, but always with the same message saying a particular macro (could be any of many) cannot be run because it is invalid. Of course, it does exist and it is valid.

I'd really appreciate the help of the selfless gurus of Tek-Tips to assist me in putting this back to normal. I've got a large company with 20+ users depending on me and I'm at a complete loss to understand what's causing the issue.

Thanks.
 
Can we assume there is some VBA in addition to macros? Does your code compile?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Yes, of course there is VBA as well, and it does compile.

Let's say that I have a macro attached to the OnOpen property of a report. Among other places, I would get the error message there.

I just want to clarify that the problem itself is new, while the database has been up and running with the same instructions forever.
 
Thank you so much. This is an excellent resource.

Many of those suggestions have been included in my database for a very long time but some are new to me.
I really appreciate the help. It gives me several different directions to go.

It's going to take time to review all of them in context, and something I didn't even mention is that one day a routine might display the error, and then the next it's normal operation as always.

BTW, sorry for the late reply. I've been unable to respond until now but your help is really invaluable.

I'll let you know how it plays out.
 
I have finally had a chance to test all the suggestions made in the link.

Workaround 1 – Use Single Step Mode to Test the Macro

I thought this had the most promise but it turned out that the single-step was never triggered. The error occurred before any of the macro steps were run. That's enlightening in itself but it had no bearing on correction.

Workaround 2 – Run MS Access Database without VBA code

The error doesn't occur on login. It only happens intermittently on various routines within the database, so this suggestion wasn't relevant.

Workaround 3 – Turn on Trusted Access to Macros

That is on and has been on for more than a decade. This is a long-established database, so again the suggestion did not apply to me.

Workaround 4 – Update Your Computer

Computers are all updated to latest version of Win10.

Workaround 5 – Re-install Microsoft Visual C++ Runtime Libraries

This was done with no noted change in operation.

Workaround 6 – Repair the Access Database

This has also been done several times without success.

Thank you for the suggestions, but they didn't provide a solution. Do you have any other ideas?

 
Have you tried creating a new, blank accdb and importing all of the objects?

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top