D
Dave Ramage
Hello,
Can anyone tell me if/how it is possible to cancel the installation of an
addin from either Workbook_Open or Workbook_AddinInstall?
I want to prevent users from installing an addin file if it located on a
network drive. The problem is that once the user has started the installation
process (either by double clicking the file in explorer or through
Tools/Iddins), it seems difficult to stop by VBA code!
This is what I've tried so far:
Private Sub Workbook_AddinInstall()
Dim a As AddIn
If OnNetworkDrive(Thisworkbook.FullName) Then 'returns true if file is on
network drive
Thisworkbook.Close
For Each a In Application.AddIns
If a.Name = ThisWorkbook.Name Then
a.Installed = False
End If
Next a
Exit Sub
End If
'goes on to install menus etc.
End Sub
This closes the addin workbook OK, but does not prevent the addin being
installed- i.e. next time Excel is started, the add-in is loaded.
Thanks,
Dave
Can anyone tell me if/how it is possible to cancel the installation of an
addin from either Workbook_Open or Workbook_AddinInstall?
I want to prevent users from installing an addin file if it located on a
network drive. The problem is that once the user has started the installation
process (either by double clicking the file in explorer or through
Tools/Iddins), it seems difficult to stop by VBA code!
This is what I've tried so far:
Private Sub Workbook_AddinInstall()
Dim a As AddIn
If OnNetworkDrive(Thisworkbook.FullName) Then 'returns true if file is on
network drive
Thisworkbook.Close
For Each a In Application.AddIns
If a.Name = ThisWorkbook.Name Then
a.Installed = False
End If
Next a
Exit Sub
End If
'goes on to install menus etc.
End Sub
This closes the addin workbook OK, but does not prevent the addin being
installed- i.e. next time Excel is started, the add-in is loaded.
Thanks,
Dave