code triggering virus scan software? is a line counter!

Ouka

New Member
Joined
Mar 28, 2011
Messages
17
See code below (commented out for your safety :LOL:):

Code:
'Sub CountCodeLines()'    Dim VBCodeModule As Object
'    Dim NumLines As Long, N As Long
'    With ActiveWorkbook
'          For N = 1 To .VBProject.VBComponents.Count
'                Set VBCodeModule = .VBProject.VBComponents(N).CodeModule
'                NumLines = NumLines + VBCodeModule.CountOfLines
'          Next
'    End With
'    MsgBox "Total number of lines of code in the project = " & NumLines, , "Code Lines"
'    Set VBCodeModule = Nothing
'End Sub

'original code by [URL="http://johnske.xlvba.fr.yuku.com/"]johnske[/URL]  from [url]http://xlvba.fr.yuku.com/topic/112/VBA-code-lines-count-number-of-lines-in-project#.VgHg-dJViko[/url]

This is triggering our enterprise virus scan as detecting "X97M/Generic@MM"

The cleaning action nukes the entire module that the code is located on.

I've confirmed that this sole block of code is causing the problem, as I have broken each chunk of code out and put it in their own document and then let the auto-scan do its thing. It only wipes the file that has this chunk in it.

Can anyone help me understand what is causing the scanner to freak out and if there is syntax I can change to avoid this happening in the future?
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,836
Office Version
  1. 2010
Platform
  1. Windows
I think the solution is to use a different virus scanner. Code that modifies code (or appears that it could, in your case) makes a lot of virus scanners nervous.
 

Ouka

New Member
Joined
Mar 28, 2011
Messages
17
would that I could, as a lowly BA doing a side project, influence a multi-national corporation to change their choice of enterprise virus scanners =P
 

Forum statistics

Threads
1,181,499
Messages
5,930,271
Members
436,726
Latest member
mmhill

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top