Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Close button on Custom Menu Bars


Hi all!

I would really appreciate if someone could tell me how to
disable the close button on a custom menu bar, i have an
API for the window but i was wondering if theres one
avaliable for the custom bar?

Yours Hopefully

Aaron
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Close button on Custom Menu Bars


Hey thanks for the code, i'm afraid im refering to the
close 'x' button on the dialog.

If you have any ideas let me know

Thanks

Aaron

-----Original Message-----
Aaron,


I posted the following sample for an earlier question and

I think it will
help you as well:

Try the following;

'This line will toggle the entire File menu for your

workbook.
Application.CommandBars("File").Enabled = Not
Application.CommandBars("File").Enabled

'This line will toggle just the Save menu item within the

File menu for your
workbook.
Application.CommandBars("File").Controls("Save"). Enabled

= Not
Application.CommandBars("File").Controls("Save"). Enabled


In this sample I select the "Save" menu item within

the "File" menu. It
should work just as well for your custom menu if you know

the names of both
the custom menu and the button you want to disable. To

test this out I
built a simple custom menu name "SampleCommandBar" with

a "Close" button
then ran the following code;

Application.CommandBars("SampleCommandBar").Contr ols

("Close").Enabled = Not
Application.CommandBars("SampleCommandBar").Contr ols

("Close").Enabled

When I run this code the custom button toggled between

enabled and disabled.

Good luck


"Aaron" wrote in message
...

Hi all!

I would really appreciate if someone could tell me how

to
disable the close button on a custom menu bar, i have an
API for the window but i was wondering if theres one
avaliable for the custom bar?

Yours Hopefully

Aaron



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Close button on Custom Menu Bars

I think you're looking for: msoBarNoChangeVisible

Option Explicit
Sub testme()

Dim cb As CommandBar

On Error Resume Next
Application.CommandBars("test").Delete
On Error GoTo 0

Set cb = Application.CommandBars.Add(Name:="test", temporary:=True)
With cb
.Visible = True
.Protection = msoBarNoChangeVisible
End With

End Sub

I couldn't hide it, but I could delete it.


Aaron wrote:

Hi all!

I would really appreciate if someone could tell me how to
disable the close button on a custom menu bar, i have an
API for the window but i was wondering if theres one
avaliable for the custom bar?

Yours Hopefully

Aaron


--

Dave Peterson

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
Delete custom menu bars Martin Walter Setting up and Configuration of Excel 1 June 27th 06 01:15 PM
close button does not close goplayoutside Excel Discussion (Misc queries) 1 October 11th 05 03:42 PM
Lost all my menu bars and tool bars CathyJ Excel Discussion (Misc queries) 3 August 8th 05 12:49 PM
Excel shoud not close all active books when clicking close button technomike Excel Discussion (Misc queries) 0 June 10th 05 05:35 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM


All times are GMT +1. The time now is 09:24 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"