the reason for this is that although the macros have been
deleted a module folder still exists. In the VB editor
you will see a module folder. Expand this, then right
click on the module shown (probably 'Module1') and
choose 'Remove..'. Click 'No' in the next dialog and
Save. You won't see the macro dialog when you re-open the
file.
For Each vbMod In ActiveWorkbook.VBProject.VBComponents
Select Case vbMod.Type
Case 1, 2, 3: 'module, class, userform
ThisWorkbook.VBProject.VBComponents.remove vbMod
Case Else 'ThisWorkbook, sheet modules
With vbMod.CodeModule
.DeleteLines 1, .CountOfLines
End With
End Select
Next vbMod
Make sure that you don't leave it in the workbook though
--
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.