Run macro from addin - xlsx workbook

Formula11

Active Member
Joined
Mar 1, 2005
Messages
433
Office Version
  1. 365
Platform
  1. Windows
Is it possible to run a macro from a normal xlsx workbook, with the macro located in an addin.
I've tried using a text box, right-click Assign Macro, this didn't work.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Yes, you can run a macro from an xlsx workbook when all the macro code is located in a xla, xlam, or xlsb workbook. To save an xlsx workbook containing any VBA code you will have to accept that all code will be removed in the save.
 
Upvote 0
Solution
Thanks for replying.
Yes you're right, it was because I had to input path with the right-click, Assign Marco:
VBA Code:
'....folder_path\add_in_name.xlam'!Sub_Name
 
Upvote 0
Would it be possible to run a macro by clicking on a hyperlink?
Again the macro is in the addin and the workbook is xlsx.
 
Upvote 0
Would it be possible to run a macro by clicking on a hyperlink?
Again the macro is in the addin and the workbook is xlsx.
Never done that myself with the macro in an addin installed in the xlsx workbook so I'm not sure.

An alternative would be:
Put the macro in a .xlsm or.xlsb workbook (let's call it WkBkX)​
In a Thisworkbook Workbook_Open module for WkBkX, Call the macro you want to run​
In the xlsx workbook add a hyperlink that, when clicked, opens the WkBkX workbook​
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top