Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Crerating a temporary menu button

Lionel,

Put this cose in the ThisWorkbook module

Sub Auto_Close()
On Error Resume Next
' in case there isn't a bar to delete
Application.CommandBars("worksheet menu bar").Delete
End Sub

It's also a good idea to have
Application.CommandBars("worksheet menu bar").Delete
at the beginning of the code that creats the bar in the first place.
(Just in case a version already exists).

steve

"Lionel Fridjhon" wrote in message
...
am trying to create a menu button that is deleted when
the workbook is closed.

I have the following piece of code that puts the button
in place, but it remains in the worksheet toolbar when I
close:

Set ComBar = CommandBars("worksheet menu bar")
With ComBar
.Controls.Add(Type:=msoControlButton,
temporary:=True, befo=6).Caption = "&Process CLiMET"
.Controls("Process CLiMET").Style =
msoButtonCaption
.Controls("PROCESS CLIMET").OnAction
= "SelectFolderToProcess"
End With

Can anyone help?

Lionel



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't delete menu button Ltat42a Excel Discussion (Misc queries) 7 November 12th 05 11:00 PM
Seagate Button on Menu Warman Excel Discussion (Misc queries) 2 January 14th 05 02:41 PM
What is the "TextBridge" menu button used for? KenLeeSmith Excel Worksheet Functions 1 November 8th 04 04:20 PM
Crerating a temporary menu button Ron de Bruin Excel Programming 0 July 30th 03 03:59 PM
Making menu item changes temporary Randy Johnson Excel Programming 3 July 17th 03 03:20 AM


All times are GMT +1. The time now is 03:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"