Fire macro in Personal.xlsb on ANY workbook open - vba

I am attempting to place a macro in Personal.xlsb that will fire whenever any workbook is opened. I have searched multple sites for an answer and all relate to Auto_Open or WorkBook_Open which have to be in a macro running in the workbook being opened. Is there a way to see these events from another workbook?

Related

VBA Userform read another workbook dynamically without opening it

I'm fairly new to VBA. I'm trying to create a user form where the user can select another workbook as read only and copy some of the data to the current workbook. I don't want the other workbook to open.
I found this https://www.encodedna.com/excel/copy-data-from-closed-excel-workbook-without-opening.htm but the excel document is hard coded. Is it possible to select a workbook dynamically, through a file dialog without that workbook popping up?
Thank you

Creating a Macro That Can Run on Any Excel Sheet That I Open [duplicate]

How can I write macro in Excel that will work (to run with shortcut) on any excel document which I will open?
Is this possible?
You need to add your macros to Personal.xlsb in order to make them available to all the excel files. Choose Personal Macro Workbook in Record Macro dialog to do this quickly.
Source: http://office.microsoft.com/en-in/excel-help/copy-your-macros-to-a-personal-macro-workbook-HA102174076.aspx

Can we send a reminder email using excel vba even when sheet is not open but computer having the sheet is on?

Basically It is kind of Order Management System which will have list of all orders. What I need is all the subscribers should get a email for active orders on regular basis but for this excel sheet should be opened once in a day. Can this thing work without even opening excel sheet. Is there any way I can implement this?
When you open an Excel spreadsheet it will open one of the worksheets.
You can write some VBA in there to execute when the workbook is opened.
Option Explicit
Dim Autorun App as Application
Private Sub App_WorkbookOpen(ByVal Wb As Workbook)
Do your stuff here
End Sub
The code in the middle should set an event on a timer (for when to send the emails) and then have a separate routine to send the emails.
You can also set your computer to open the excel spreadsheet automatically when you turn it on. Then there is nothing to forget.

Creating a button with macro on a different workbook

I currently have a macro which creates another workbook and adds a button to it. I've assigned a macro to the button, but I believe I still need the master workbook to actually run the macro.
Is there a way to have the macro run on the new workbook without referring to the master workbook? In other words, is it possible to programmatically add a button to a new workbook with a macro and have it be independent of the original workbook?
Thanks in advance!
I'd go like this:
have your "master" workbook with a template worksheet whit both an ActiveX button and its corresponding code in its code pane
say its name is "TemplateSheetWithButtonAndCode"
in your macro use
Worksheets("TemplateSheetWithButtonAndCode").Copy
ActiveWorkbook.SaveAs "c:\MyFolder\MyWorkbooK"
this will generate a new workbook with a copy of your "template" worksheet as its only worksheet, along with necessary code to have the button work
Place the button on a template worksheet. Place the button's associated macro in that worksheet's code area.
If you export the worksheet to another workbook, you will also be exporting the button and the macro.

Triggering external macro on button click from normal excel workbook (.xlsx)

Stated simply my question is as follows Is it possible for a button on a worksheet in a normal excel workbook (.xlsx not .xlsm) to trigger a macro in another file specifically an installed excel add in (.xlam).
Here is some background on why I want to achieve this. I have a workbook that many users need to be able to view but only some need to be able to update by filling in a form on another sheet and calling a macro in an add in. The worksheet should not contain any macros to avoid security warnings when opened by normal users. I can do this by having a ribbon button in the add in that the user clicks which will then check that the correct workbook is open and that the form is filled in etc. before executing the update code. However the interface would be nicer if the button instead of appearing on the ribbon was on the worksheet just below the form. Therefore my question is it possible to trigger an external macro from a button click in a non macro enabled workbook.
Yes, you can assign an external macro (which should be .xlsm file) to a non-macro-enabled workbook (.xlsx) button. My xlsm macro resides in the same directory as the xlsx workbook for simplicity. (Note: I am using Excel 2010)
Firstly, you must open your xlsm macro in the same instance of Excel window (i.e. do not open a new instance of Excel) so that your xlsx workbook will be able to see/access it.
Right-click on your xlsx workbook button and select "Assign Macro..."
Make sure you select Macros in: All Open Workbooks
All macros in open workbooks will be shown (this is why it is important to do step 1).
Select the desired macro from the list then click OK.
I don't see how you can execute a macro from a control in a non-macro-enabled workbook.