#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default no menu's


Hi,

I would like to set my excel workbook up so that i dont see any menu'
rows or anything. This is to give it the look like it is a non exce
application. I would need it to only be aplicable to this workbook an
so that any other excel books there were opened would beopened in
separate regular book

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=39641

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default no menu's

Hi,

To make all other workbooks open in a separate Excel window, you need to set
the Application property 'IgnorRemoterequests' to True when your special
workbook is opened, and false when it is closed (this is the same as checking
the box in the Options dialog for 'Ignore Remote Applications')

To disable all commandbars, you loop through the Commandbars collection,
setting each members 'Enabled' property to False, and reset them when the
workbook is closed.

So, in the VB Editor of Excel, in the Workbook_open event procedure of the
ThisWorkbook class module, you would put code like this:

CODE SAMPLE

dim xBar as commandbar

' DISABLE ALL COMMANDBARS, TGOOLBARS, MENUS !!!
for each xbar in commandbars ' includes menus, AND commandbars!
xbar.enabled=false
next

application.ignoreremoterequests=true
<<< END <<<

and in the workbook_close event handler of the same module, you would have
code like this:

SAMPLE CODE

dim xBar as commandbar

' DISABLE ALL COMMANDBARS, TGOOLBARS, MENUS !!!
for each xbar in commandbars ' includes menus, AND commandbars!
xbar.enabled=true
next

application.ignoreremoterequests=false

<<< END <<<

BTW, this also prevents anyone using the Toolbar List menu...but anyone can
double-click on the area at the top of the Excel window, and they get the
Customize Commandbars dialog, which allows them to add their own commandbars
and menus...

In Office XP (or is it 2002/2003 ?), you can disable this feature by setting
the "application.commandbars.disablecustomize" property to true, and reset it
when the workbook is closed.

BTW:
If Excel crashes, then the Workbook_Close event will not fire, so next time
you open Excel it may still have all the menus and commandbars disabled, and
the only way to reset them is using the code above (close event).

Also, unless you prevent people having access to the VB Editor and the
workbooks VB Project, they can easily open up the VB Editor (ALT-F11, or
ALT-F8 in MS Excel) and run some code to reset the menus - to get around that
you have to disable keystrokes using the OnKey property of the Application
object (yes, reset the defaults when the workbook is closed)

If you leave the property 'ignoreremoterequests' set to false, then Windows
will give you an error when you double-click on a file in Explorer to open
it, or when you double-click an attachment in MS Outlook, so be aware that
this property needs to be reset when the workbook is closed, or, next time
you open Excel, on the Tools menu, Options dialog, you can uncheck the box
that says 'Ignore remote applications'

HTH

Philip

"ceemo" wrote:


Hi,

I would like to set my excel workbook up so that i dont see any menu's
rows or anything. This is to give it the look like it is a non excel
application. I would need it to only be aplicable to this workbook and
so that any other excel books there were opened would beopened in a
separate regular book.


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=396411


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default no menu's

Option Explicit

Private mFormulaBar

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = True
Next oCB

Application.DisplayFormulaBar = mFormulaBar
End Sub

Private Sub Workbook_Open()
Dim oCB As CommandBar
For Each oCB In Application.CommandBars
oCB.Enabled = False
Next oCB

mFormulaBar = Application.DisplayFormulaBar
Application.DisplayFormulaBar = False
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

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


"ceemo" wrote in
message ...

Hi,

I would like to set my excel workbook up so that i dont see any menu's
rows or anything. This is to give it the look like it is a non excel
application. I would need it to only be aplicable to this workbook and
so that any other excel books there were opened would beopened in a
separate regular book.


--
ceemo
------------------------------------------------------------------------
ceemo's Profile:

http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=396411



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default no menu's


Wow thanks peeps just what i wante

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=39641

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default no menu's


Ive had a play with the function that stops other books being opened i
the same excel application.

If there is already a book open it will close the menu's from that boo
as well is there anyway around this

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=39641



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default no menu's

Hi

Use the activate and deactivate events
See
http://www.rondebruin.com/menuid.htm



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


"ceemo" wrote in message
...

Ive had a play with the function that stops other books being opened in
the same excel application.

If there is already a book open it will close the menu's from that book
as well is there anyway around this?


--
ceemo
------------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=396411



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default no menu's

Uh, I don't think I know what you are talking about.

--

HTH

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


"ceemo" wrote in message
...

Ive had a play with the function that stops other books being opened in
the same excel application.

If there is already a book open it will close the menu's from that book
as well is there anyway around this?


--
ceemo
------------------------------------------------------------------------
ceemo's Profile:

http://www.excelforum.com/member.php...o&userid=10650
View this thread: http://www.excelforum.com/showthread...hreadid=396411



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
Drop Down menu's Lee Excel Discussion (Misc queries) 2 December 4th 07 04:35 PM
Pull Down menu's Robin Excel Worksheet Functions 7 October 7th 05 09:31 PM
Drop Down Menu's abfabrob Excel Discussion (Misc queries) 4 February 4th 05 02:19 PM
Custom menu's Stu[_33_] Excel Programming 3 April 1st 04 10:02 PM
Pull Down Menu's [email protected] Excel Programming 5 November 3rd 03 05:48 PM


All times are GMT +1. The time now is 10:36 AM.

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"