Need to ignore Comadd-in.

RagingR12

New Member
Joined
Sep 17, 2018
Messages
18
I am working on a project.

In this project the excel sheet may only be saved if some cells are filld in.
The form also only me be save if it’s an .xlm.

I got this working, but one of the excel comadd-ins is not listening to the do not save command in my workbook.
Wat happens is, is that when we save-as the window first pop-up correctly
But coms a second time thereafter.
When I turn this comadd-ins it works fine.
Now the problem is I can’t use:
application.comaddins("ApplicationAddin.AddinModule").connect = False

As this is blocked by Admin.
Is there another way to ignore this comadd-ins.
Or the prevent the second save-as window.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If you can switch the add-in off, the code should be able to as well. What error do you get when you try it?
 
Upvote 0
Rory thanks for replying.
I don't get an error.
I get two times the save-as window.
the first time as intended (akkoording to my code)
the second time not as intended (this because of the plug-in
 
Upvote 0
So this line doesn't error, it just does nothing:

Code:
application.comaddins("ApplicationAddin.AddinModule").connect = False
 
Upvote 0
When I use that code I get the following error:
"Run-time error '-2147467259 (80004005)':
This add-in is installed for all users on this computer and can only be connected or disonnected by an administrator."

But in My code I removed this line, becauce off above error
 
Upvote 0
Here is my current code:


Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
' set preference on save-as to xlsm
'    Cancel = True
'    stop if reviewer and review type not filled
    If Range("B1").Value = "Select type" Then
        response = MsgBox("You must choose a type before you can save your file.", vbCritical, "WARNING!")
        Exit Sub
    End If
    If Range("B3").Value = "" Then
        response = MsgBox("You must enter the date before you can save your file.", vbCritical, "WARNING!")
        Exit Sub
    End If
'force .xlsm
    If Not SaveAsUI Then Exit Sub
     
    On Error GoTo ErrorHandler
     
    Cancel = True
         
    Dim FileName As String
    FileName = Application.GetSaveAsFilename(FileFilter:="Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")

    If FileName = "False" Then Exit Sub
         
    Application.EnableEvents = False
    ThisWorkbook.SaveAs FileName:=FileName, FileFormat:=xlOpenXMLWorkbookMacroEnabled
    

         
ErrorHandler:
    Application.EnableEvents = True

End Sub
 
Upvote 0
When I use that code I get the following error:
"Run-time error '-2147467259 (80004005)':
This add-in is installed for all users on this computer and can only be connected or disonnected by an administrator."

But you can manually unload it?
 
Upvote 0
Yes I can Manually unload it, but this document is needed to be used by allot of people. That can’t or won’t do this.

So I want to automat this.

But I can’t use
Code:
[COLOR=#574123][FONT=Calibri]application.comaddins(ApplicationAddin.AddinModule").connect= False[/FONT][/COLOR]
because of the mentioned error

So is there another way to block input or the workings off COMadd-ins?
 
Upvote 0
What I'm saying is that I find it strange that you can manually unload it but not do it in code. If that is the case, there really isn't anything you can do, as far as I know.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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