Excel 2013
I created a workbook with some VBA code that will be used as a template. I did some research and realized that using an addin was the way to go, in case I would need to update the code.
I found some help on creating the addin by Chip Pearson below.
Installing An Add-In
I am loading the addin through a workbook open event.
When the workbook opens, the addin in is loaded and I have tested that saving something new to the *.xla file works (just added a line 'This is a test' to the top of a module)
However, the worksheets disappear?
If I unload the add-in and install it manually, either through Chip's code or through the addin button it seems to work fine. Any ideas?
Thanks for the help in advance.
I created a workbook with some VBA code that will be used as a template. I did some research and realized that using an addin was the way to go, in case I would need to update the code.
I found some help on creating the addin by Chip Pearson below.
Installing An Add-In
I am loading the addin through a workbook open event.
Code:
Sub InstallAddIn()
' This is used to install the addin.... only needed once. Update name to install another addinn
Dim AI As Excel.AddIn
Set AI = Application.AddIns.Add(Filename:="[URL="file://\\files\trans\_Dept"]\\files\trans\_Dept[/URL] 52\2015 NBIS Monitoring\Templates\Field Files\Single Span Underclear Sheet.xla")
AI.Installed = True
End Sub
Sub InstallAddIn2()
' Use this load at start up to load latest version of the code.
''''''''''''''''''''''''''''''''''''
' Installed = True to load Add In,
' Installed = False to unload Add In
''''''''''''''''''''''''''''''''''''
Application.AddIns("Single Span Underclear Sheet").Installed = True ' or False
End Sub
Private Sub Workbook_Open()
'At startup, this macro will trigger to update the addin (code from the template)
Call InstallAddIn2
End Sub
However, the worksheets disappear?
If I unload the add-in and install it manually, either through Chip's code or through the addin button it seems to work fine. Any ideas?
Thanks for the help in advance.