Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Bringing the Add-in to excel...?

I've created an excel add-in. Now I want to bring it to my excel
application. I would want a toolbar button such that whenever I click
on it I want my add-in to work?

Any Ideas?

--deostroll

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Bringing the Add-in to excel...?

Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("myToolbar").Delete
On Error GoTo 0
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
Dim oCtl As CommandBarControl

On Error Resume Next
Application.CommandBars("myToolbar").Delete
On Error GoTo 0

Set oCB = Application.CommandBars.Add(Name:="myToolbar",
temporary:=True)
With oCB
Set oCtl = .Controls.Add(Type:=msoControlButton)
With oCtl
.BeginGroup = True
.Caption = "myButton"
.OnAction = "myButton"
.FaceId = 27
End With
End With

End Sub


'To add this, go to the VB IDE (ALT-F11 from Excel), and in
'the explorer pane, select your workbook. Then select the
'ThisWorkbook object (it's in Microsoft Excel Objects which
'might need expanding). Double-click the ThisWorkbook and
'a code window will open up. Copy this code into there,
'changing the caption and action to suit.

'This is part of the workbook, and will only exist with the
'workbook, but will be available to anyone who opens the
'workbook.


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"deostroll" wrote in message
oups.com...
I've created an excel add-in. Now I want to bring it to my excel
application. I would want a toolbar button such that whenever I click
on it I want my add-in to work?

Any Ideas?

--deostroll



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
Tables in excel- bringing down formulas for new records. Ben Excel Worksheet Functions 2 May 19th 10 12:35 AM
Bringing Data From Access To Excel Alistaire Green[_2_] Excel Worksheet Functions 8 July 30th 07 09:44 PM
Bringing in a Union Query with excel? S Davis Excel Worksheet Functions 3 August 24th 06 06:52 PM
Bringing Word doc into Excel Gary Excel Discussion (Misc queries) 1 March 10th 05 08:19 PM
Bringing Excel to the front Scott Holmes Excel Programming 3 August 26th 03 06:22 AM


All times are GMT +1. The time now is 01:26 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"