ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   no menu's (https://www.excelbanter.com/excel-programming/337502-no-menus.html)

ceemo[_10_]

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


Philip

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



Bob Phillips[_6_]

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




ceemo[_11_]

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


ceemo[_12_]

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


Ron de Bruin

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




Bob Phillips[_6_]

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





All times are GMT +1. The time now is 03:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com