PC Review


Reply
Thread Tools Rate Thread

Disable AddIn via automation

 
 
daboul
Guest
Posts: n/a
 
      11th Sep 2008
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
 
Reply With Quote
 
 
 
 
Kent Prokopy
Guest
Posts: n/a
 
      11th Sep 2008
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

 
Reply With Quote
 
Kent Prokopy
Guest
Posts: n/a
 
      11th Sep 2008
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

 
Reply With Quote
 
Kent Prokopy
Guest
Posts: n/a
 
      11th Sep 2008
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

 
Reply With Quote
 
daboul
Guest
Posts: n/a
 
      16th Sep 2008
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automation AddIn (UDF) in C# not able to manipulate XL Objects... pdxJaxon Microsoft Excel Programming 3 16th Jul 2008 05:10 AM
Unshimmed Automation Addin and Shimmed COM Addin in same App Domai =?Utf-8?B?QnJhbmRvbg==?= Microsoft Excel Programming 0 27th Jun 2006 11:18 PM
Installing Addin via Automation Aragorn Microsoft Excel Programming 6 26th Oct 2005 10:54 PM
addIn functions in automation nicgendron Microsoft Excel Programming 1 14th Jul 2005 10:35 AM
Automation COM Addin with Excel Puneet Microsoft Excel Programming 0 12th Jul 2004 07:50 PM


Features
 

Advertising
 

Newsgroups
 


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