Opening excel sheets automatically disables addins. Is there a fix for this?

halleluljah

New Member
Joined
Feb 22, 2011
Messages
4
Hi,

I use the following code to open a number of specific workbooks in excel automatically on booting a computer. However, the add-ins in these workbooks are disabled when they open. I have code to auto install the necessary add-ins, which works fine normally, but doesn't work on the sheets that are opened by this code. Can anybody see a solution to this problem?

Here is the macro for opening the sheets automatically...

Sub StartNewApp()

i = 2

Do Until IsEmpty(Cells(i, 1).Value)

Dim xlApp As New Application
Dim Wkbook As String

Set xlApp = New Excel.Application

Wkbook = Cells(i, 1).Value

xlApp.Workbooks.Open Wkbook
xlApp.ActiveWorkbook.Windows(1).Visible = True

xlApp.Visible = True

ThisWorkbook.Activate

i = i + 1

Loop

End Sub

Here is the code for auto installing the add-ins....


Sub Add_an_Addin()

Dim oAddin As AddIn

Set aAddin = AddIns.Add("dirAddin1", True)
Set bAddin = AddIns.Add("dirAddin2", True)
Set cAddin = AddIns.Add("dirAddin3", True)

If Not aAddin.Installed Then
aAddin.Installed = True
End If

If Not bAddin.Installed Then
bAddin.Installed = True
End If

If Not cAddin.Installed Then
cAddin.Installed = True
End If


End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Automating Excel never loads addins. You need to toggle the installed property. Do you really want a separate Excel instance for every workbook?
 
Upvote 0
Loop through each addin, if its Installed property is True, then set it to False and back to True again and that will actually load it.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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