I have an Outlook Module that contains the VBA Code below. The VBA code opens an Excel Add-In called TMAPAddIn.xlam, which then displays a User Form. I exported the Module and gave it to other colleagues so that they can import it to their Outlook, this allowed them to make a custom button on their Outlook Quick Access Toolbar.
The code works great, takes about 5 seconds for the User Form to display and the code executes without a problem. The file is open as ReadOnly to ensure multiple users can run the add in at the same time, without ever having to worry about them modifying its contents. I would like to know if my code can be written better for speed / efficiency.
I've written this code only for purposes of ensuring everyone runs and opens the latest version of TMAPAddIn.xlam, unfortunately I don't have the resources or time to develop a COM Add-In.
Sub LaunchTMAP() Dim ExApp As Object Set ExApp = CreateObject("Excel.Application") Dim informationalBox As UserForm2 Set informationalBox = New UserForm2 informationalBox.Show 'letting the user know the workbook is downloading so they dont think Outlook froze Dim ExWbk As Workbook Set ExWbk = ExApp.Workbooks.Open("Z/TMAPAddIn.xlam", ReadOnly:=True) 'Z is a network drive informationalBox.Hide ExWbk.Application.Run "Module1.example" ExApp = Nothing ExWbk = Nothing End Sub