menu bar

A

Atishoo

I have developed a spreadsheet that contains every control I need, including
save and exit etc, as buttons embeded within the sheet.
Is there a way to remove the menu column (File edit view insert etc) from
the top of the page??
I suspect the answer is a unresounding NO! but hey worth trying!
 
M

Mike H

Hi,

The answer is a resounding YES although it is a bit drastic

Application.CommandBars("Worksheet Menu Bar").Enabled = False

Put this in the workbook_open event and in the workbook before_close event
with false change to TRUE

Mike
 
R

Rick Rothstein \(MVP - VB\)

If you are allowed to use VBA code, execute this to hide the menu bar...

Application.CommandBars("Worksheet Menu Bar").Enabled = False

Use this to show it again...

Application.CommandBars("Worksheet Menu Bar").Enabled = True

Rick
 
A

Atishoo

Its great and works well , nearly locked myself out though! I created a macro
to bring back the menu bar then realised I cant activiate the damned thing
cos I aint got a menu bar!! Doh ! fortunately it has so many errors it soon
threw up a debug error message!!
 
R

Rick Rothstein \(MVP - VB\)

You could always press Alt+F11 to get into the VBA editor and enter

Application.CommandBars("Worksheet Menu Bar").Enabled = True

in the Immediate window in order to bring back the menu bar. As for your
other question, "stopping" what, the debug error messages? You probably
won't like the answer, but I think "fix your code" would be the usual
response.<g> Seriously though, I don't think anyone will be able to help you
with that unless you tell us what the errors are and show us your code (and
identify where the program stops when issuing the error message).

Rick
 
A

Atishoo

lol!!
Dang!! I have to fix my code!! cant a programer be shoddy anymore
(programmer is a bit strong, bloke with a pc is as good as it gets!)

Sorry I asked completely the wrong question! what I should have asked is how
do I lock others out of vba editor! even by interupting code execution
 
G

Gord Dibben

If you have no menu bar hit Alt + F11 to open the Visual Basic Editor.

You can run the macro straight from the module you placed it in.

OR just copy Rick's one-liner to the Immediate Window and ENTER

Can't answer about all the errors...........can't see the code.


Gord Dibben MS Excel MVP
 
R

Rick Rothstein \(MVP - VB\)

Can you take a look at Atishoo's last response to me (where he clarifies
what he meant to ask)? Excel security is not one of my strengths and I
thought you might be able to provide him with direction. Thanks.

Rick
 
D

Dave Peterson

Open excel
Open your workbook
Open the VBE
Select your workbook's project
Tools|VBA Project Properties|Protection tab

Give it a memorable password.

Save and close and reopen the workbook to test.

Be aware that this password (like every other password) can be broken by any
person who really wants to.
 
G

Gord Dibben

See Dave's reply about VBA code protection.

Code interruption will not unprotect or show the code module when an error
arises.


Gord
 
A

Atishoo

thats brilliant dave! I thought that interuptions in code execution would
automatically allow debug but your right it doesnt! thanks again
 
A

Atishoo

Hi Rick
could you do me a huge favour and take a look at my question labelled web
box address!
I have been exchanging ideas with Joel and he has given me a code that
returns the address of the workbook rather than that of the browsers open
page that Im after.
Im not convinced that the problem lies with my web boxes as I have tried
dragging a web box onto a blank workbook from the control toolbox and setting
navigate2 etc from a workbook open event and I still get the same return of
the workbook address. I think the problem is that the code below reffers to a
command bar for the whole page not specific to webbrowser2 as I want! Do you
happen to know how I should reference webbrowser2's current open page?

I have had some very decent advice and bits of code off you before hence
would appreciate your advice!

thanks John


webaddress = ""
Set WebBar = Application.CommandBars("Web").Controls
For Each Item In WebBar
If Item.Type = msoControlComboBox Then
webaddress = Item.text
Exit For
End If

Next Item
Cells(ActiveCell.Row, "ar").Value = webaddress
 
A

Atishoo

Hi rick its OK just sussed it:-

Cells(ActiveCell.Row, "ar").Value = Me.WebBrowser2.LocationURL

simple in the end
ta john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top