Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2008

Tip: Looking for answers? Try searching our database.

Default template

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Erwin Bormans - 09 Jan 2008 11:25 GMT
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
JP - 09 Jan 2008 18:23 GMT
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

http://www.bettersolutions.com/excel/EHN113/VT621416331.htm

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@verwijderdit_telenet.be> wrote:
> Hi all
>
[quoted text clipped - 10 lines]
> Kind regards
> Erwin
Gord Dibben - 09 Jan 2008 18:33 GMT
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.

http://www.contextures.on.ca/xlToolbar02.html

She also has a download sample workbook for you to adjust for your use.

Gord Dibben  MS Excel MVP

>Hi all
>
[quoted text clipped - 10 lines]
>Kind regards
>Erwin
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.