VBA code disappeared when open workbook in other computer

X

xuanzhiyi

Hi all,

I wrote a VBA project in Excel workbook in one computer(WinXP,
Execl97), there are over 10 classes and 5 modules, compiled and tested.


Later, I copy the file to another machine(Win2000, Excel2002), and
tried to open the VBA editor, all classes and modules disappeared! Then
I uninstalled Excel2002 and installed Excel2003, still codes were
missing.

Strange thing is:
1. One of my friends can open the excel file correctly in his
computer(WinXP, Excel2003).
2. I can open some other excel file's VBA code.

Is there anyone met this kind of problem before? all kinds of help are
appreciated.

-Xuan
 
G

Greg Wilson

I've heard through this NG that McAfee virusscanner and possibly others can
delete entire modules if it finds code of the type that manipulates the VBA
Project - e.g. InsertLines, DeleteLines etc. A post from June 2, 2005 from
Amedee Van Gasse stated:

Snippet:
And if you have a McAfee virusscanner, it will cheerfully erase any
code module that contains .InsertLines.

--
Amedee Van Gasse using XanaNews 1.17.4.1

Snippet:
Which is no guarantee. I experienced the problem with McAfee, but other
AV may do the same. Perhaps not now but who knows about future versions?

The problem is with .InsertLines (and also with .DeleteLines). Some
macro viruses use this to add their own code to other workbooks. So a
proactive AV may not know the virus yet, but it sees the .InsertLines
activity and it say, better safe than sorry.

If you have a standalone AV, you can perhaps disable this particular
scanning feature. With a managed or network scanner: don't know,
perhaps not.

In My Humble Opinion it is important that not only you know there can
be a problem, but also WHY there can be a problem. That way you can
work around it.
 
X

xuanzhiyi

Hi Greg,

Thanks for this information indeed. However currently I've no NV on my
machine but Zonealarm firewall5.5. Anyway, you remind me there are
other reasons than just excel version differ.

In my weird machine, I have also .NET framework2.0, C#2.0, MSSQL2005,
IIS4, mysql and php running, I self config the services too. Besides I
have OpenOffice1.1 installed. About the MS office family, I customly
installed Word, Excel, Access and PowerPoint2003. Will one of these
reasons cause the code disappeared?

-Xuan
 

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