Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Security Warning Incorrectly Claims Macros Are Present

  Asked By: Bonni    Date: Aug 27    Category: MS Office    Views: 692
  

The Security Warning is lying to me!

I create a workbook with a short or empty macro and then delete the
macro. I then save the workbook. I re-open the workbook and a Security
Warning window appears claiming my workbook has a macro and asks
if I want to enable macros or not.

I am running at the Medium Excel security level.

How do I convince Excel that the workbook really doesn't have any
macros and that the Security Warning is unneeded?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Ellen Simpson     Answered On: Aug 27

If you created a new module to put the macro in, you need to delete
the module as well.

Unless this is an older version of EXCEL? If so, there is VBA code
out there to delete all presence of macro remnants from a workbook --
but you need to place it and run it out of another workbook's VBA
environment.

 
Answer #2    Answered By: Patricia Johnson     Answered On: Aug 27

Ah yes, therein lies the problem. If you remove the macro via
Tools>Macro>Macros>Delete rather than by removing the module, then
Excel still believes a macro exists. Went into the Visual Basic Editor
just to verify that no modules existed.

However, if you first delete the module, then all traces of the macro
appear to go away.

OK, now I am stuck with several workbooks in which I eliminated the
macros using the logical but apparently incorrect way. So how do I fix
the situation? For example, can I go into Microsoft Script Editor and
do something useful?

I am using Excel 2003 SP2.

 
Answer #3    Answered By: Calandre Bernard     Answered On: Aug 27

Prior to getting EXCEL 2003, this is the macro I used to have to run (from
another workbook) to remove all traces of a macro:

Sub RemoveMacros()
Dim O As Object
For Each O In ActiveWorkbook.Sheets
If TypeName(O) = "Worksheet" Then
Select Case O.Type
Case xlExcel4MacroSheet, xlExcel4IntlMacroSheet
Application.DisplayAlerts = False
O.Delete
Application.DisplayAlerts = True
End Select
End If
Next
With ActiveWorkbook.VBProject
For Each O In .VBComponents
Select Case O.Type
Case 1, 2 ' standard or class module
.VBComponents.Remove O
Case Else ' form or document
With O.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next
End With
End Sub

I've never needed to use it for EXCEL 2003, so I'm not sure if it would
still work for it or not...

 
Answer #4    Answered By: Alyssa Campbell     Answered On: Aug 27

Thanks for the macro. Tried it but it needs debugging for use with
Excel 2003.

Decided to take a fresh look in Visual Basic Editor to see if I could
spot anything. Discovered I had overlooked the existence of a module.
Although it was completely empty, it was still listed under
View>Project Explorer. I deleted that module and eureka, Excel no
longer thinks I have any macros.

 
Didn't find what you were looking for? Find more on Security Warning Incorrectly Claims Macros Are Present Or get search suggestion and latest updates.




Tagged: