Call a Form from an addin

ericontheroad

New Member
Joined
Mar 7, 2009
Messages
4
Hi
Note that I tested the below in a Workbook then recreated the code in a xla workbook. It worked in a regular workbook but the call path errors out in the xla.

In a regular workbook, I had a sub macro simply calling the form.
Code:
Sub MyMacro1()
    FmMkeffect.Show
End Sub
I saved this same sub in the xla module but the path doesn't seem to be recognized. Is there something to be added because it's now a xla workbook?

My addin is creating a Menu bar in excel. My target was to call Sub MyMacro1 from the menu bar and call the form that way.
Thansk
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,155
Presuming you have the xla installed, how are you calling the procedure 'MyMacro1'?
 
Upvote 0

GTO

MrExcel MVP
Joined
Dec 9, 2008
Messages
6,155
Oops. Critters musta hit the Post Reply button when I wasn't lookin'.

The below presumes an .xla filename of 'Temp.xla' and that the procedure 'MyMacro1' is in 'Module1'.

Code:
Sub CallIt()
    
    Application.Run "Temp.xla!Module1.MyMacro1"
        
End Sub
 
Upvote 0

Forum statistics

Threads
1,191,483
Messages
5,986,845
Members
440,053
Latest member
jhollingworth

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
Top