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
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