computer






 

Question by  bobbobsson (24)

How do you create a toolbar in Excel VBA?

I need to create a toolbar in Excel VBA.

 
+7

Answer by  ahsanmahmoodawan (1169)

add this bit of code to the thisworkbook module option explict private sub workbook_open() addnewtoolbar end sub private sub workbook_beforclose(cancel as boolean) deletetoolbar end sub this is the easy method for creating a toolbar

 
+6

Answer by  redbaron (6)

In VBA a toolbar is a command bar. A command bar could be a toolbar or a menu. In the CommandBars Collection Object use the Add method. Here is an example of creating a toolbar of the name "Test Toolbar" docked at the top and visible: Set cbar = CommandBars.Add(Name:="My Toolbar", Position:=msoBarTop) cbar.Visible = True

 
+5

Answer by  gigo (1706)

Just use the command mandBars.Add( name of the toolbar, temporary: true/false, position: top/bottom ). With .OnAction you have to add handler routines afterwards.

 
+5

Answer by  blkconservative (46)

You will need to open Excel and open visual basic editor add the appropriate code from what is called the "code pane". Insert your module copy, save and close it.

 
+3

Answer by  LKHomemailgmailcom (60)

A toolbar is simple and may be created manually or through VBA by downloading the toolbar calculator add-in which is a self-extracting EXE file that extracts a single XLA file.

 
You have 50 words left!