Cannot run the macro "filename1". The macro may not be available in this workbook or all macros may be disabled.

I've working on Macro Function (by VBA) which is in Excel.

When I create macro function and register function directly on toolbar(ribbon?),
the macro doesn't have any problem to run.

but the problem is happing,
when i close file and excel completely, and i open new file with other name and try to run the macro by pressing macro button, it keeps showing error below.

Cannot run the macro "filename1". The macro may not be available in this workbook or all macros may be disabled.

i've enabled macro setting as "allow all macro enabled"..

what am i supposed to change or add it.?

Also, I need the macro button available for 1 or 2 users in Active directory as well.

Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi there,

First of all, what is your Office (Excel) version?

Second, when you create your macro function you are given a list of choices on where you want your Macro to be saved. By default it's saved in your current workbook. That means your Excel file will contain your macro function. So if you want to use it in another Excel file, then you must have the original file opened so that Excel can access your macro function.
Another option when creating your macro would be to chose to save your macro in your Personal Macro Workbook, which is a file stored in your windows profile, then your macro will be accessible to any of your Excel open files.
ndoorsinteractiveAuthor Commented:
Thanks for your comments.
I've registered personal.xlsd file in C:\Users\USERNAME\AppData\Roaming\Microsoft\Excel\XLSTART

Now, it starts automatically whenver excel opens.
but, I still get this error (attached file)
i'm not what problem is. is it problem on VBscript..?

Please open your Visual Basic Editor (Developer tab) then open the source code of the macro you have registered in your Personal.xlsb file. Check the code content and see if there is somewhere a call to open Book2.htm. If you find that line, please remove it, then save and close your macro.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

ndoorsinteractiveAuthor Commented:
Is it problem beacause of inside VBscript code.?
I don't see any Book2.htm or .htm naming code inside of it.
Your macro IS VBscript code.
When you record a macro, VB script code is generated.

It looks that something triggers a call to open a file called Book2.htm. Something, somewhere tries to open that file, it doesn't find it, so it shows an error message.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ndoorsinteractiveAuthor Commented:
I've resolved it. I copied script and place into new module
that it works.

Thanks for your followup
You're welcome.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.