ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable AddIn via automation (https://www.excelbanter.com/excel-programming/416899-disable-addin-via-automation.html)

daboul

Disable AddIn via automation
 
Hi,
I run an Excel in Word using the COM automation API:
pApp.CreateInstance(Excel::Application)
My issue is that this Excel instance is using an addin I wrote, which is
fine, but also some others addin that aren't working properly and that are
preventing me from driving the Excel instance.

So, I'd like to be able to run an Excel instance with no addins launched at
all, but still via the COM automation. In fact, I'd like to launch an Excel
exactly as when you type "excel.exe /s" (i.e. in safe mode), so that I'll be
sure that nothing is launched as an addin and preventing me from using Excel.

Does anyone as any idea how I could do that ?

Note that launching "excel.exe /s" isn't good enough because that won't
enable me to drive the Excel via the COM automation API.

Any help or ideas would be greatly appreciated,
David.
Edit/Delete Message

Kent Prokopy

Disable AddIn via automation
 
After you open Excel you can uninstall the addins

Public Sub main()
Dim a As AddIn

For Each a In AddIns
If a.Installed Then
a.Installed = False
End If
Next a
End Sub

"daboul" wrote:

Hi,
I run an Excel in Word using the COM automation API:
pApp.CreateInstance(Excel::Application)
My issue is that this Excel instance is using an addin I wrote, which is
fine, but also some others addin that aren't working properly and that are
preventing me from driving the Excel instance.

So, I'd like to be able to run an Excel instance with no addins launched at
all, but still via the COM automation. In fact, I'd like to launch an Excel
exactly as when you type "excel.exe /s" (i.e. in safe mode), so that I'll be
sure that nothing is launched as an addin and preventing me from using Excel.

Does anyone as any idea how I could do that ?

Note that launching "excel.exe /s" isn't good enough because that won't
enable me to drive the Excel via the COM automation API.

Any help or ideas would be greatly appreciated,
David.
Edit/Delete Message


Kent Prokopy

Disable AddIn via automation
 
When you are done re-install the addins with this:

Dim AddinsList() As String

Public Sub main()
Dim a As AddIn
Dim x As Integer

x = 0
For Each a In AddIns
If a.Installed Then

ReDim Preserve AddinsList(x) As String
AddinsList(x) = a.Title
a.Installed = False
x = x + 1
End If
Next a

For x = 0 To UBound(AddinsList)
AddIns(AddinsList(x)).Installed = True
Next x
End Sub

"daboul" wrote:

Hi,
I run an Excel in Word using the COM automation API:
pApp.CreateInstance(Excel::Application)
My issue is that this Excel instance is using an addin I wrote, which is
fine, but also some others addin that aren't working properly and that are
preventing me from driving the Excel instance.

So, I'd like to be able to run an Excel instance with no addins launched at
all, but still via the COM automation. In fact, I'd like to launch an Excel
exactly as when you type "excel.exe /s" (i.e. in safe mode), so that I'll be
sure that nothing is launched as an addin and preventing me from using Excel.

Does anyone as any idea how I could do that ?

Note that launching "excel.exe /s" isn't good enough because that won't
enable me to drive the Excel via the COM automation API.

Any help or ideas would be greatly appreciated,
David.
Edit/Delete Message


Kent Prokopy

Disable AddIn via automation
 
If no addins are loaded at the time this will error unless you add the
following before you uninstall.

If x = 0 Then Exit Sub

"Kent Prokopy" wrote:

When you are done re-install the addins with this:

Dim AddinsList() As String

Public Sub main()
Dim a As AddIn
Dim x As Integer

x = 0
For Each a In AddIns
If a.Installed Then

ReDim Preserve AddinsList(x) As String
AddinsList(x) = a.Title
a.Installed = False
x = x + 1
End If
Next a

If x = 0 Then Exit Sub
For x = 0 To UBound(AddinsList)
AddIns(AddinsList(x)).Installed = True
Next x
End Sub

"daboul" wrote:

Hi,
I run an Excel in Word using the COM automation API:
pApp.CreateInstance(Excel::Application)
My issue is that this Excel instance is using an addin I wrote, which is
fine, but also some others addin that aren't working properly and that are
preventing me from driving the Excel instance.

So, I'd like to be able to run an Excel instance with no addins launched at
all, but still via the COM automation. In fact, I'd like to launch an Excel
exactly as when you type "excel.exe /s" (i.e. in safe mode), so that I'll be
sure that nothing is launched as an addin and preventing me from using Excel.

Does anyone as any idea how I could do that ?

Note that launching "excel.exe /s" isn't good enough because that won't
enable me to drive the Excel via the COM automation API.

Any help or ideas would be greatly appreciated,
David.
Edit/Delete Message


daboul

Disable AddIn via automation
 
Hi,
Thanks Kent, I'll try that and I'll keep you in touch.

David.

"Kent Prokopy" wrote:

If no addins are loaded at the time this will error unless you add the
following before you uninstall.

If x = 0 Then Exit Sub

"Kent Prokopy" wrote:

When you are done re-install the addins with this:

Dim AddinsList() As String

Public Sub main()
Dim a As AddIn
Dim x As Integer

x = 0
For Each a In AddIns
If a.Installed Then

ReDim Preserve AddinsList(x) As String
AddinsList(x) = a.Title
a.Installed = False
x = x + 1
End If
Next a

If x = 0 Then Exit Sub
For x = 0 To UBound(AddinsList)
AddIns(AddinsList(x)).Installed = True
Next x
End Sub

"daboul" wrote:

Hi,
I run an Excel in Word using the COM automation API:
pApp.CreateInstance(Excel::Application)
My issue is that this Excel instance is using an addin I wrote, which is
fine, but also some others addin that aren't working properly and that are
preventing me from driving the Excel instance.

So, I'd like to be able to run an Excel instance with no addins launched at
all, but still via the COM automation. In fact, I'd like to launch an Excel
exactly as when you type "excel.exe /s" (i.e. in safe mode), so that I'll be
sure that nothing is launched as an addin and preventing me from using Excel.

Does anyone as any idea how I could do that ?

Note that launching "excel.exe /s" isn't good enough because that won't
enable me to drive the Excel via the COM automation API.

Any help or ideas would be greatly appreciated,
David.
Edit/Delete Message



All times are GMT +1. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com