I'm using the following code to write to a worksheet's module after it is created:
Short Version
This is triggering a McAfee alert for my users who have it installed on their system. Those settings are controlled by their IT departments. I can see if their IT departments will grant an exception, but I anticipate it being quite difficult and would prefer to work around this issue myself.
Is there a better way to accomplish my goal that won't **** off a virus scanner?
Long Version
I need to utilize the Private Sub Worksheet_SelectionChange(ByVal Target As Range), but the worksheet where that code should reside is deleted and rebuilt with each update. My workaround was to house the main portion of the code in a Module and then utilize VBProject to write a call to that code into the worksheet after it is rebuilt. Unfortunately, it seems that use of this code is consistent with some ancient viruses from the mid-90s that McAfee still keeps an eye out for, so some of my clients have reported that the code is completely wiped clean as soon as they receive the file. I know they could change the settings for their virus program, but at least one of them said that option is reserved for an admin (read: IT dept). I'm sure it will be a pain to get authorization to change those settings, so I'd like to fix this myself.
Is there a better way to accomplish my goal that won't **** off a virus scanner? Is it possible to write to a worksheet module through another method that doesn't utilize VBProject, or is there a different way to utilize VBProject that doesn't put up a big, red flag?
Thanks, in advance.
ps - Why does this site blot out on_Click (no underscore)?
Code:
Sub buildVBA()
Dim vbc As Object
Dim StartLine As Long
Dim cLines As Long
For Each vbc In ThisWorkbook.VBProject.VBComponents
If vbc.Properties("Name") = "Comparison - Critical" Then
With vbc.CodeModule
cLines = .CountOfLines + 1
.InsertLines cLines, _
"Private Sub Worksheet_SelectionChange(ByVal Target As Range)" & Chr(13) & _
"Call *******(Target, ""criticalRange"")" & Chr(13) & _
"End Sub"
End With
Next vbc
End Sub
This is triggering a McAfee alert for my users who have it installed on their system. Those settings are controlled by their IT departments. I can see if their IT departments will grant an exception, but I anticipate it being quite difficult and would prefer to work around this issue myself.
Is there a better way to accomplish my goal that won't **** off a virus scanner?
Long Version
I need to utilize the Private Sub Worksheet_SelectionChange(ByVal Target As Range), but the worksheet where that code should reside is deleted and rebuilt with each update. My workaround was to house the main portion of the code in a Module and then utilize VBProject to write a call to that code into the worksheet after it is rebuilt. Unfortunately, it seems that use of this code is consistent with some ancient viruses from the mid-90s that McAfee still keeps an eye out for, so some of my clients have reported that the code is completely wiped clean as soon as they receive the file. I know they could change the settings for their virus program, but at least one of them said that option is reserved for an admin (read: IT dept). I'm sure it will be a pain to get authorization to change those settings, so I'd like to fix this myself.
Is there a better way to accomplish my goal that won't **** off a virus scanner? Is it possible to write to a worksheet module through another method that doesn't utilize VBProject, or is there a different way to utilize VBProject that doesn't put up a big, red flag?
Thanks, in advance.
ps - Why does this site blot out on_Click (no underscore)?
Last edited: