Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course



I download the file :Pass-Arguments-to-a-Macro-Called-from-a-Button-or-Sheet-in-Excel_1893.xlsm

But the button is not working.




Hi and Jan2 welcome to the Forum.

I assume you're referring to the file from Pass Arguments to a Macro Called from a Button or Sheet in Excel and that when you open the file you get a message like "Cannot run the macro... all macros may have be disabled"

Assuming you can run macros normally (i.e. you have them enabled), then go via the ribbon File/ Options/ Trust Center and click Trust Center Settings... Pick Trusted locations then click Add new location... Then browse to the file's location (probably your Downloads folder but you might want to change that) and click OK. Click OK twice again to close the dialogs then close the file.

Re-open the file and click the blue Button- you now should get the message "I clicked a button!"

Hope this fixes your problem. If so, please be sure toreturn and mark this Answer as Selected.



That is the problem. I don't get the message 'cannot run the macro....'
Jan2 Aug 30, '23 at 4:03 am
Are macros enabled? If not, go to Trust Center Settings... then Macro Settings and enable (or disable with notification) and try again.

Other possibility is the file has the "mark of the web" (MOTW) but mine didn't. Right click on file, choose Properties and in the General tab untick the box near the bottom (Security: This file came from...). Okay and reopen.

If that doesn't work and you're using a business computer, your system administrators may have disabled macros via a policy. Can't help in that case! 
John_Ru (rep: 6172) Aug 30, '23 at 6:06 am
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login