Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default Workbook_BeforeClose

Hi!

I use the Workbook_Open() event to add a custom commandbar and a custom
commandbarcontrol.
I want to remove both commandbars when the user closes the workbook . I've
tried to use the Workbook_BeforeClose event, but that returns an error (see
code below) - 91:

Sub Workbook_BeforeClose
CommandBars(1).Controls("Tid&lista").Delete
CommandBars("Tidlista").Delete
End Sub

Any ideas?

TIA
PO


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Workbook_BeforeClose

Assuming that Menu is hanging off of Worksheet Menu Bar, this should work

Sub Workbook_BeforeClose
CommandBars(1).Controls("Tid&lista").Delete
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"PO" <po wrote in message ...
Hi!

I use the Workbook_Open() event to add a custom commandbar and a custom
commandbarcontrol.
I want to remove both commandbars when the user closes the workbook . I've
tried to use the Workbook_BeforeClose event, but that returns an error

(see
code below) - 91:

Sub Workbook_BeforeClose
CommandBars(1).Controls("Tid&lista").Delete
CommandBars("Tidlista").Delete
End Sub

Any ideas?

TIA
PO




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Workbook_BeforeClose

Hi PO

We don't see the code that create the bar so it is diffecult to give a answer but
you can find your answer here

http://support.microsoft.com/default...02&Product=xlw
How to customize menus and menu bars in Excel
http://support.microsoft.com/default...09&Product=xlw
XL2000: Sample Macros that Customize and Control Shortcut Menus
http://support.microsoft.com/default...50&Product=xlw
XL2000: Sample Macros for Customizing Menus and Submenus

http://support.microsoft.com/default...55&Product=xlw
XL97: WE1183: "Customizing Menu Bars, Menus, and Menu Items"
http://support.microsoft.com/default...19&Product=xlw
XL97: Sample Macros for Customizing Menus and Submenus
http://support.microsoft.com/default...78&Product=xlw
XL97: Sample Macros That Customize and Control Shortcut Menus

--
Regards Ron de Bruin
http://www.rondebruin.nl



"PO" <po wrote in message ...
Hi!

I use the Workbook_Open() event to add a custom commandbar and a custom
commandbarcontrol.
I want to remove both commandbars when the user closes the workbook . I've
tried to use the Workbook_BeforeClose event, but that returns an error (see
code below) - 91:

Sub Workbook_BeforeClose
CommandBars(1).Controls("Tid&lista").Delete
CommandBars("Tidlista").Delete
End Sub

Any ideas?

TIA
PO




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
Workbook_BeforeClose Ed Davis[_2_] Excel Discussion (Misc queries) 21 September 26th 09 01:01 AM
Workbook_BeforeClose Question Sashi Excel Worksheet Functions 7 July 26th 07 08:36 PM
Workbook_beforeclose +msgbox Phoenix Excel Programming 0 October 19th 04 01:19 PM
Workbook_BeforeClose Don Guillett[_4_] Excel Programming 1 August 31st 04 02:27 PM
Workbook_BeforeClose JimP Excel Programming 1 July 5th 04 10:39 PM


All times are GMT +1. The time now is 10:57 PM.

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

About Us

"It's about Microsoft Excel"