Excel macro is recognised as a virus

J

Julian

I have written a macro to connect to Outlook and send emails according to a
list in a worksheet. For about a day, some of the classes and modules kept
disappearing from the workbook when I saved it. I have now tracked this down
to Symantec Antivirus thinking my workbook had a virus and helpfully deleting
all my hard work!

What can I do to avoid this happening? I know this is an awkward question
because this is the way many viruses work. However, Outlook has an object
model that is accessible from Excel VBA and I have a legitimate need to do
this.

Is there anything I can do in the way I write the code? Or will code signing
help?

Thanks for any thoughts and suggestions.

Julian
 
B

Bernie Deitrick

Julian,

You need to set SAV's bloodhound feature to ignore your documents, or at least, the documents that
you put into a specific folder. If you have an IT department, they will be the ones who will be
able to do it. Otherwise, I think you can set the autoprotect options through the AV menu.

HTH,
Bernie
MS Excel MVP
 
J

Julian

Thanks. I've done that but I'd rather be able to create my code in a way that
doesn't look like a virus, which it isn't. Macros and VBA start to lose their
appeal if you can't create them for someone else without finding a way to
exclude them from virus checking. Many corporates won't allow the user this
ability to config the AV.

Julian
 
B

Bernie Deitrick

Unfortunately, connecting to Outlook and sending email is a signature feature of many macro
viruses - the first office virus did exactly that. So, if you don't want it to look like a virus,
don't use Outlook, and don't modify code in the VBProject using code. Since that is what you want
to do - you're out of luck, unless your store the file with the macro code in a place that isn't
scanned - good luck.
 
T

Tim Zych

Code can be "restructured" to get around the Bloodhound heuristics. A while
ago I discovered a way to get around the virus detection while running code
from the Extensibility Library (code that manipulates code). If you're
interested email me privately. Email is on the website.
 

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.

Ask a Question

Top