Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Detecting Macro code behind a sheet
Hi,
I'm writing a macro that cycles through all the sheets in another workbook detecting if there is any code behind them. Useful if you want to quickly find out if someones slipped in some code in a 20+ sheet model and don't fancy clicking on each one in the VB Editor to find out...only way I know!! Anyway the code below is kicking out errors - starting with user-type not defined... This may involve making changes to the references section in the VB Editor, but I want a solution that will work for anyone.. Dim VBComp As Object Dim VBCodeMod As CodeModule For intcount = 1 To ActiveWorkbook.Sheets.count sht_name = Sheets(intcount).Name Set VBCodeMod = ActiveWorkbook.VBProject.VBComponents (sht_name).CodeModule If VBCodeMod.CountOfLines 0 Then macro = "True" Else macro = "" End If Next intcount |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Copy Excel Chart Sheet to PowePoint - Mod of Jon Peltier code | Charts and Charting in Excel | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
Detecting Duplicate Sums - Worksheet code | Excel Discussion (Misc queries) | |||
is there anyway to make it so the users of my excel spread sheet cant view the macro code w/o a password? | Excel Worksheet Functions | |||
Detecting VBA code | Excel Programming |