PC Review


Reply
Thread Tools Rate Thread

Bringing the Add-in to excel...?

 
 
deostroll
Guest
Posts: n/a
 
      1st Jun 2007
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 With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      1st Jun 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Help bringing in hyperlink into Excel from Web Don Guillett Microsoft Excel Programming 1 15th Sep 2011 11:29 PM
Paste Link (from Excel) Not bringing in Excel formatting? Livin Microsoft Powerpoint 1 13th Jun 2009 05:28 AM
Bringing in data from excel =?Utf-8?B?UmVwb3J0IEd1eQ==?= Microsoft Access External Data 6 1st Jun 2007 12:46 AM
Bringing Word doc into Excel Gary Microsoft Excel Misc 1 10th Mar 2005 08:19 PM
Bringing in info from excel Teresa Sell Microsoft Access External Data 1 22nd Feb 2004 08:30 AM


Features
 

Advertising
 

Newsgroups
 


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