Results 1 to 9 of 9
  1. #1
    A.Rubin
    Guest

    Macro virus protection and VBA

    Is there any way to detect whether Macro Virus Protection is activated, or to change its status from a VBA macro. (I know it should always be on -- my intended use is to add to an indent style macro package, a check to see that it's on, and to warn the user that it should be on.)

    Version is Excel 97 SR-2 (f) -- I think most users have the same version, but I've seen an SR-1.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    I do not believe that property is available to VBA code.
    Legare Coleman

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    If this option would be available, the first line of code you would expect to see in a macro virus program is switching the macro virus protection from high to low. I don't think it was the intention of MS that the user would have the possibility to programmatically change this. Just try to record the macro where you choose Tools >> Macro >> Protection and switch the macro virus protection from high to low or vice versa. Then have a look at the code that was recorded: that's right, you will see nothing at all.
    As Legare said, this option is not available and if it was, I would uninstall MS Office!!

  4. #4
    A.Rubin
    Guest

    Re: Macro virus protection and VBA

    Well, it's available in Word 97 (SR-2) VBA:
    <pre> Options.VirusProtection=True</pre>

    This may explain why there are more Word viruses than Excel viruses? <img src=/S/yep.gif border=0 width=15 height=15>

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    I have to consider uninstalling Word ....
    I didn't know that, (I am not really a Word expert) it doesn't sound very logical to me. I think you're right about these Word macro viruses. I am a little bit allergic to macro viruses, so I always have some extra protection e.g. Norton or McAfee anti virus programs. I've seen the damage viruses can do on some of my colleagues' computers; and right, it was with Word viruses (documents attached to an email).
    Thanks for the warning.

  6. #6
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    Actually, I can't figure out why it is not available. If that first line of code that would turn it off is executed, then it means that either it is already off, or the user clicked Enable Macros on the warning screen. In either case, it doesn't make any difference if the macro can turn it off. If it is turned on, and the user clicked Don't enable macros, then the first line would never execute and can't turn it off anyhow.
    Legare Coleman

  7. #7
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Kortrijk, Belgium
    Posts
    571
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    You are right Legare. I was a little bit fast with my comment, that's because I don't like it.
    I tried to run the Options.VirusProtection = False in a Word macro (Word 2000) but I don't know what the command really does. I thought it would switch virusprotection from high protection to low protection, but after running the command, this didn't change. Do I have it right if this command switches off macro virusprotection, without changing what the user actually can see? This seems to be very strange ...

  8. #8
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    I don't have a clue what that is, if it exists, what values it would be set to, or what it is supposed to do.
    Legare Coleman

  9. #9
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Macro virus protection and VBA

    See the VB/VBA forum where some discussion is taking place re disabling Word's macro security.
    <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=vb&Number=22929&page=0&view =expanded&sb=5#Post22929>Word97SR2: bypass the macro security check</A>

    Just thought it may be relevant

Posting Permissions

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