Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code which should create a command bar and add 17
buttons. I shortened the example to 3 buttons to save readers time. Sub Workbook_Open() 'Delete CommandBar if it exists On Error Resume Next CommandBars("DataEntry").Delete On Error GoTo 0 CommandBars.Add Name:="DataEntry" With Application.CommandBars("DataEntry").Controls.Add( temporary:=True) .Caption = "Anti Virus" .OnAction = "PasteAntiVirus" End With With Application.CommandBars("DataEntry").Controls.Add( temporary:=True) .Caption = "Audio" .OnAction = "PasteAudio" End With With Application.CommandBars("DataEntry").Controls.Add( temporary:=True) .Caption = "Backup" .OnAction = "PasteBackup" End With End Sub When I open the spreadsheet the macro stops at the line CommandBars.Add Name:="DataEntry" The error message is "Run Time error '91' Object Variable ot With Block Variable not set I have looked through previous postings but none seem relevant to my problem. The macro runs when I open the spreadsheet. My XL version is 2000 running on Win98. Can anyone point me in the right direction please David P |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Repetive Formatting/Creating a Toolbar button | Excel Discussion (Misc queries) | |||
Creating Custom Commands on a Toolbar | Excel Worksheet Functions | |||
XLSTART-Creating a toolbar | Setting up and Configuration of Excel | |||
macro toolbar | Excel Discussion (Misc queries) | |||
Creating a macro that simulates some of the toolbar button | New Users to Excel |