LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 328
Default Unable to disable macro

Hi, I have created a macro in a worksheet, to disable the menu toolbars etc.
I had also protected the sheet (which I've since removed).

The *very* frustrating problem is, any other workbook I open now (either new
or existing) prevents me from rightclicking on the mouse to insert rows
columns etc.

I am presuming it is something to do with the macro I created, which looks
like as below, but I want to switch everything off and return back to normal
Excel operation when this workbook is closed. Can anyone point me in the
right direction - perhaps its an excel option somewhere I simply need to
switch off?

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


 
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
Disable running of SelectionChange macro when in another macro? Tonso Excel Discussion (Misc queries) 6 March 21st 10 06:50 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
unable to record macro Denis[_4_] Excel Programming 0 June 29th 06 05:21 PM
Unable to run Macro in an Add-in [email protected] Excel Worksheet Functions 0 January 23rd 06 07:18 PM
Disable Macro at open by an external macro Ricardo[_2_] Excel Programming 0 November 10th 03 07:50 PM


All times are GMT +1. The time now is 08:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"