Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Enable or Disable" macros dialog box for excel 2

Status
Not open for further replies.

Mack2

Instructor
Mar 12, 2003
336
US
I am trying to disable the "Enable Disable macros" Dialog box when I open an excel spreadsheet. I have deleted all of the macros and modules within the spreadsheet. And the dialog box still comes up! All I want is to not have that macros dialog box to NOT pop up. PLEASE HELP! THANK YOU IN ADVANCE!
 
Do you have a Personal.xls? It sounds like you might. Depending on your version Excel will look for it and if found will open it. Sounds like it has found one and there is a macro in the Personal trying to run.
 




Hi,

There can be code in the Worksheet or Workbook objects.

Activate the VB Editor.

Select in the Code Window.

Edit/Find - Select []b Current Project[/b] - Search for sub and search for function



Skip,

[glasses] [red][/red]
[tongue]
 
Have you checked the code on the sheets? It sounds like there is a macro hidden somewhere.

Anyway, tools / macros / security is where I think you should go (currently at work and this is disabled so I can't check). With a low security setting it won't prompt for an answer. Of course, this is the setting for excel in general rather than the spreadsheet itself, so it might not be what you want.

Fen
 
SkipVought...I searched for those two words, and it found the empty procedure's for the default events. Like Workbook_Open. But there is no code in the procedures.

I did at one time have a command button, but that has been deleted. Within the vb editor, it shows my two worksheets and the thisworkbook object only.
 
Fenrirshowl....I went up to the macro dialog box, and it does not show any macro's.
 
I even deleted the two worksheets that originally had the code. And added a new blank worksheet. And the macro dialog box still comes up. So something must be attached to the workbook.........THIS IS CRAZY!!
 
SkipVought...I searched for those two words, and it found the empty procedure's for the default events.

I assume you deleted them. Go to each and press ctrl + A to select everything and hit delete. Dumb as it may sound, I have seen code, where the programmer tried to hide it, by inserting blank lines before the code. A shortened vertical scroll bar will be your first hint.
 
Did that and it still comes up. But something interesting....When I open the workbook, and select the disable Macros button, a message box comes up and says "this workbook contains a type of macro (version 4) that cannot be deleted"
I have only used vs 2003.

 
I am in the process of installing it. What is is suppose to do?
THANKS FOR YOUR HELP
 
I do not have any worksheets hidden. What are macro sheets?
 
I think Skip is onto something. I just tried this on a old workbook:
Code:
Sub test()
Dim c
Dim a As Long
Dim temp

Set c = ActiveWorkbook.Sheets

For Each c In Sheets
   temp = c.Name
   Sheets(temp).Visible = True
Next

End Sub

The sheets with the dialog boxes are not visible in VBA editor. In version 4 userforms were created on sheets and the above code should expose them.
 
Update:
I removed all the macro's from the v4 workbook and saved. When I opened up there was no macro warning. I then inserted a version 4 macro sheet, saved, and closed. Opening up the workbook again gave me the macro enable/disable dialog. Clicking on disable gave me the same dialog "this workbook contains a type of macro (version 4) that cannot be disabled".
 
When you say "old workbook", are you refering to an old version of excel. Because everything has been created in vs2003
 
I just created a new workbook (2000) and inserted a v4 macro sheet. When I reopened it I got the macro warning with the qualifier that it couldn't be disabled. Run the code I provided above and see what shows up.
 
THAT WORKED!!!!! I ran the code, and a new tab came up. Then deleted the tab, and reopened the workbook. AND NO MACRO DIALOG BOX CAME UP!! Thank you so much, you guys are great!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top