Can a macro in the personal.xlsm be called from within an open macro that is in the workbook?

rltidd27

New Member
Joined
Mar 18, 2017
Messages
18
Office Version
  1. 365
Platform
  1. Windows
I have this simple macro in the Personal worksheet and it works fine when run.
I then put this macro into the Open Macro I want to use when opening the file
'msgbox testing
Sub messageBox()
MsgBox ("Ok to here")
End Sub

Here is the open macro.
Private Sub Workbook_Open()
'this macro is to unprotect and show all sheets

'Sub Open_Setup()

'Call UnProtectAllSheets

'Call UnhideVeryHiddenSheets

'Call Switch_to_Quote

'Call Unhide_AD_and_AE
Call messageBox

End Sub

Upon opening, here is the error message I receive:
Microsoft Visual Basic for Applications
Compile error:
Sub or Function not defined

Anything that I try to call within the WorkBook Open macro to the personal workbook, will not run.
I am presuming that you can not call a macro in the Personal workbook from the open macro.
Any help is appreciated.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try
VBA Code:
Application.Run "Personal.xlsb!messageBox"
 
Upvote 1
Solution
It looks like my reply is gone.
Thanks so very much for your help!
This worked perfectly and solved a problem I have been working on for some time.
Have a GREAT day!
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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