Results 1 to 3 of 3

Thread: Macro Viruses

  1. #1

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    We had the WM-97 virus here, and being a good employee I reported it and sent a copy to our systems department. But I didn't keep a copy for myself.

    Part of what the virus did was write modules to other open documents. I am working on a macro now where I want to add a command button (easy enough) and add code behind it. But I can't figure out how to add code to a module at runtime.

    Any ideas? Or does anyone have a copy of the macro virus out there? Thanks for your help!

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Posts
    30
    Its not really that tough. You can tell it to search for extensions such as .doc or .txt, and you could write to it without it being open. The only problem is, specifying the document, because who knows what the user named it. But writing it to a text file or whatever is simple, just Open As Input #1 and Read till EOF.
    Sheehan Alam
    CEO, Omnicron Software

  3. #3

    Thread Starter
    Hyperactive Member billwagnon's Avatar
    Join Date
    Jul 1999
    Location
    St. Louis, Missouri, Mississippi Valley
    Posts
    290
    No, what I am trying to do is create a new Word document or Excel sheet with a macro in the code module attached to the object.

    For example, in the past I have created new documents, made changes, and then saved as a different document name.

    What I would like to do is write a macro that will add a module to a new document/workbook at run time.

    The WM97 virus did this by writing an autorun macro to Normal.dot. Normal.dot then propagated the virus by inserting modules and writing its own code to the modules.

    I want to do something similar in VBA to create a new workbook that includes a macro. The easy way around, I suppose, would be to copy my existing data from a worksheet into a blank worksheet that contained the macro. But I am trying to figure out how to write the macro at runtime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width