LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Cancel Addin Install from Workbook_AddinInstall?

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


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Addin - 1. Links & 2. Install/Uninstall Error Message MSweetG222 Excel Programming 0 March 15th 06 03:33 AM
Using Workbook_AddinInstall -vs- Workbook_Open Events Bill Schanks Excel Programming 3 December 23rd 05 04:18 AM
Save & Install AddIn with VBA Matt Excel Programming 1 September 23rd 04 03:40 PM
Install Addin in Excel Jos Vens Excel Programming 0 July 8th 04 11:18 PM
Cannot install Excel 2002 Analysis Addin Toolpak robbyn Excel Programming 2 January 30th 04 11:41 PM


All times are GMT +1. The time now is 05:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"