new workbook

C

ceemo

I am using the below to close all menu's when opening a workbook.

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

application.ignoreremoterequests=true

End Sub


the last line before end sub stops other work books being opened in the
current excel app and opens a new app for them. However if excel is
already open when i open this code the other workbooks are affected by
the menu changes. This is what i dont want.

Is there any way i can get my book to open in a fresh version of excel
if there are other spreadsheets open?
 
B

Bob Phillips

I think you are saying that you only want the menus disabled for this one
workbook, the new version of Excel is a side issue?

If so, you need to add your enable/disable menu code to the
Workbook_Activate and Workbook_Deactivate events as well.

--

HTH

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

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

Similar Threads

RunWhen error 4
Hide the close X in excel 2
Code Stopped 2
Works too well - Hide toolbar Macro 4
Impossible? - Close code 1
Time close and save 0
Unable to disable macro 11
Close help 2

Top