Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Exel2000 VBA - Creating a Command Bar - Error: "Object Variable or With not Set"
In addition to Tom's remark: I see a hard return but no line continuation where you add the Button? Use: Set btnRun = barTemp.Controls.Add _ (Type:=msoControlButton, temporary:=True) Also: Dim btnRun as Office.CommandBarButton the CommandBarControl is more generic.. if u use CommandBarButton Object you'll see more properties to work with. keepITcool < email : keepitcool chello nl (with @ and .) < homepage: http://members.chello.nl/keepitcool "Tom Ogilvy" wrote: in the workbook_open event you should prefix with application Private Sub Workbook_Open() Dim barTemp As CommandBar Dim btnRun As CommandBarControl Set barTemp = Application.CommandBars.Add(Name:="Temp", _ Position:=msoBarFloating, MenuBar:=False, temporary:=True) Set btnRun = barTemp.Controls.Add (Type:=msoControlButton, temporary:=True) End Sub This usually clears up this type of problem. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert row/column error "Cannot shift object off sheet" | Excel Discussion (Misc queries) | |||
cannot insert rows -error message "cannot shift object off sheet" | Excel Discussion (Misc queries) | |||
When hiding column error messge"Can'nt shift object off sheet" | Excel Discussion (Misc queries) | |||
"Microsoft Visual Basic runtime error '424' object required". | Excel Worksheet Functions | |||
I get an error message that says "Cannot shift object off a page" | Excel Discussion (Misc queries) |