Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Ensure Addin is loaded properly by user - no double clicking

Hi,

I want to prevent users double-clicking to load my add-in. I would like a
warning to appear telling them how to install it properly.

I can detect whether Workbook_AddinInstall() has executed (code below),
which is great EXCEPT:
When the user opens excel with the add-in already installed, it does not
execute again, and my warning comes up.

Any ideas?

Thanks
Rich

Option Explicit
Dim AddInLoad As Boolean

Private Sub Workbook_AddinInstall()
AddInLoad = True
End Sub

Private Sub Workbook_Open()
If AddInLoad Then
If ThisWorkbook.IsAddin Then
MsgBox "add In - all cool"
Else
MsgBox "Not really sure if this is possible"
End If
Else
If ThisWorkbook.IsAddin Then
MsgBox "addin loaded badly, warning and exit"
Else
MsgBox "Spreadsheet only"
End If
End If
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Ensure Addin is loaded properly by user - no double clicking

Oh go on, somebody must know _something_ ;)
Rich

"Rich" wrote in message
...
Hi,

I want to prevent users double-clicking to load my add-in. I would like a
warning to appear telling them how to install it properly.

I can detect whether Workbook_AddinInstall() has executed (code below),
which is great EXCEPT:
When the user opens excel with the add-in already installed, it does not
execute again, and my warning comes up.

Any ideas?

Thanks
Rich

Option Explicit
Dim AddInLoad As Boolean

Private Sub Workbook_AddinInstall()
AddInLoad = True
End Sub

Private Sub Workbook_Open()
If AddInLoad Then
If ThisWorkbook.IsAddin Then
MsgBox "add In - all cool"
Else
MsgBox "Not really sure if this is possible"
End If
Else
If ThisWorkbook.IsAddin Then
MsgBox "addin loaded badly, warning and exit"
Else
MsgBox "Spreadsheet only"
End If
End If
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Ensure Addin is loaded properly by user - no double clicking

Hi Rich,

try something like this:

Private Sub Workbook_Open()
Dim oAdn As AddIn

On Error Resume Next
Set oAdn = AddIns(ThisWorkbook.Title)
On Error GoTo errH
If oAdn Is Nothing Then
Set oAdn = AddIns.Add(ThisWorkbook.FullName)
End If

If (Not oAdn.Installed) Then
oAdn.Installed = True
MsgBox ThisWorkbook.Title & " in Addin manager & checked"
Exit Sub

errH:
'something gone wrong !!
End Sub

Before saving, in thisworkbook properties temporarily set IsAddin to False.
In Excel goto File properties. Enter a friendly name in Title and a brief
description in Comments. Reset IsAddin to True.

Regards,
Peter T

"Rich" wrote in message
...
Hi,

I want to prevent users double-clicking to load my add-in. I would like a
warning to appear telling them how to install it properly.

I can detect whether Workbook_AddinInstall() has executed (code below),
which is great EXCEPT:
When the user opens excel with the add-in already installed, it does not
execute again, and my warning comes up.

Any ideas?

Thanks
Rich

Option Explicit
Dim AddInLoad As Boolean

Private Sub Workbook_AddinInstall()
AddInLoad = True
End Sub

Private Sub Workbook_Open()
If AddInLoad Then
If ThisWorkbook.IsAddin Then
MsgBox "add In - all cool"
Else
MsgBox "Not really sure if this is possible"
End If
Else
If ThisWorkbook.IsAddin Then
MsgBox "addin loaded badly, warning and exit"
Else
MsgBox "Spreadsheet only"
End If
End If
End Sub




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Ensure Addin is loaded properly by user - no double clicking

Hey Peter, thans for the that, I was working on a similar track, but a bit
different, put the two together and I am (nearly) there, still a few things
to iron out, but looking good, thanks



"Peter T" <peter_t@discussions wrote in message
...
Hi Rich,

try something like this:

Private Sub Workbook_Open()
Dim oAdn As AddIn

On Error Resume Next
Set oAdn = AddIns(ThisWorkbook.Title)
On Error GoTo errH
If oAdn Is Nothing Then
Set oAdn = AddIns.Add(ThisWorkbook.FullName)
End If

If (Not oAdn.Installed) Then
oAdn.Installed = True
MsgBox ThisWorkbook.Title & " in Addin manager & checked"
Exit Sub

errH:
'something gone wrong !!
End Sub

Before saving, in thisworkbook properties temporarily set IsAddin to

False.
In Excel goto File properties. Enter a friendly name in Title and a brief
description in Comments. Reset IsAddin to True.

Regards,
Peter T

"Rich" wrote in message
...
Hi,

I want to prevent users double-clicking to load my add-in. I would like

a
warning to appear telling them how to install it properly.

I can detect whether Workbook_AddinInstall() has executed (code below),
which is great EXCEPT:
When the user opens excel with the add-in already installed, it does not
execute again, and my warning comes up.

Any ideas?

Thanks
Rich

Option Explicit
Dim AddInLoad As Boolean

Private Sub Workbook_AddinInstall()
AddInLoad = True
End Sub

Private Sub Workbook_Open()
If AddInLoad Then
If ThisWorkbook.IsAddin Then
MsgBox "add In - all cool"
Else
MsgBox "Not really sure if this is possible"
End If
Else
If ThisWorkbook.IsAddin Then
MsgBox "addin loaded badly, warning and exit"
Else
MsgBox "Spreadsheet only"
End If
End If
End Sub






Reply
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
Display sheet from loaded Addin Stuart[_21_] Excel Programming 3 March 10th 05 06:59 PM
Addin opened but not loaded Jac Tremblay[_3_] Excel Programming 1 November 30th 04 04:15 PM
XLL addin not loaded! Tetsuya Oguma[_4_] Excel Programming 6 October 22nd 04 02:54 PM
Addin loaded but Macro not shown Blair C. Fonville Excel Programming 2 September 8th 04 04:26 PM
How can I ensure a message to the computer user is aknowledged? Gary Ainsworth Excel Programming 1 November 17th 03 10:37 AM


All times are GMT +1. The time now is 12:44 PM.

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"