(Msg. 1) Posted: Wed Jan 09, 2008 12:25 pm
Post subject: Default template Add to elertz Archived from groups: microsoft>public>excel>templates (more info?)
Hi all
I've made 3 macros on my computer and now I need to install these on a
couple of other computers.
I want to make a new toolbar, with 3 buttons that call these macro's.
Where can I find the default excel template? And how do I copy te macro's to
this one. If I save the new toolbar in this file and I copy this to other
PC's, do they got the toolbar automaticly aswell, or do I need to make the
toolbar on every PC?
(Msg. 2) Posted: Wed Jan 09, 2008 12:25 pm
Post subject: Re: Default template Add to elertz [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
I think the best way would be to simply export the macros and have
your users import them to their personal workbook.
1. To find/create a default workbook/sheet for Excel, check out
2. To be efficient, you can create the toolbar at runtime, for example
Private Sub Workbook_Open()
Dim cmdbar As CommandBar
Dim cmdbtn1 As CommandBarButton
Dim cmdbtn2 As CommandBarButton
Dim cmdbtn3 As CommandBarButton
Set cmdbar = Application.CommandBars.Add(Name:="My Toolbar")
Set cmdbtn1 = cmdbar.Controls.Add(msoControlButton)
Set cmdbtn2 = cmdbar.Controls.Add(msoControlButton)
Set cmdbtn3 = cmdbar.Controls.Add(msoControlButton)
With cmdbtn1
.Style = msoButtonIconAndCaption
.Caption = "Something to Do"
.OnAction = "Module1.SomeMacroInModule1"
'.Width = 170
'.FaceId = 643
End With
With cmdbtn2
.Style = msoButtonIconAndCaption
.Caption = "Something Else to Do"
.OnAction = "Module1.SomeOtherMacroInModule1"
'.Width = 170
'.FaceId = 643
End With
With cmdbtn3
.Style = msoButtonIconAndCaption
.Caption = "Last thing to Do"
.OnAction = "Module1.LastMacroInModule1"
'.Width = 170
'.FaceId = 643
End With
With cmdbar
.Visible = True
End With
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("My Toolbar").Delete
End Sub
These macros should be placed in the 'ThisWorkbook' module for the
workbook you are creating.
HTH,
JP
On Jan 9, 6:25 am, "Erwin Bormans"
<erwin.bormans.RemoveThis@verwijderdit_telenet.be> wrote:
> Hi all
>
> I've made 3 macros on my computer and now I need to install these on a
> couple of other computers.
>
> I want to make a new toolbar, with 3 buttons that call these macro's.
>
> Where can I find the default excel template? And how do I copy te macro's to
> this one. If I save the new toolbar in this file and I copy this to other
> PC's, do they got the toolbar automaticly aswell, or do I need to make the
> toolbar on every PC?
>
> Kind regards
> Erwin
(Msg. 3) Posted: Wed Jan 09, 2008 12:25 pm
Post subject: Re: Default template Add to elertz [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Make your life easier by placing the macros into a module of a new workbook.
Save that workbook as an Excel add-in.
Add code to the add-in that creates the Toolbar when it is opened
Distribute that add-in to the other computers.
For creating the the Toolbar and how to save as an add-in see Debra's site.
She also has a download sample workbook for you to adjust for your use.
Gord Dibben MS Excel MVP
On Wed, 9 Jan 2008 12:25:23 +0100, "Erwin Bormans"
<erwin.bormans RemoveThis @verwijderdit_telenet.be> wrote:
>Hi all
>
>I've made 3 macros on my computer and now I need to install these on a
>couple of other computers.
>
>I want to make a new toolbar, with 3 buttons that call these macro's.
>
>Where can I find the default excel template? And how do I copy te macro's to
>this one. If I save the new toolbar in this file and I copy this to other
>PC's, do they got the toolbar automaticly aswell, or do I need to make the
>toolbar on every PC?
>
>Kind regards
>Erwin
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum