Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macros in Book.xlt (97 SR2)

    A coworker is having a problem that I have not been able to fix. When he starts Excel, the blank workbook that opens has a macro in it. I looked for Book.xlt and could not find it on his system or on the network, so I created one. I deleted the macro from ThisWorkbook and did a SaveAs Book.xlt and put it in the Xlstart folder. I closed Excel, started Excel and looked at the View Code (VBA) for the blank workbook. The macro was there again! I attached a screen shot of it. I even made sure it was using the Book.xlt that I saved (the path was the same). I am at a loss. The reason it causes concern: Every workbook he creates has this blank macro in it and causes the Macro Virus warning to fire (when he KNOWS he did not put any macros on the workbook. It is close to the end of the day, so I will check tomorrow for a reply .
    I appreciate any help I can get on this. I know if there is an answer, I will find it here. <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

    Chuck
    Attached Images Attached Images
    Chuck Reimer
    I'm from the Government and I'm here to help...

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Macros in Book.xlt (97 SR2)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Chuck

    OK the workbook is most likely is called Personal.xls, not a template.

    Now what you need to do, is delete this code, since it is not doing anything.
    1) With Excel Open use the Windows menu and choose Unhide. This will unhide the Personal.xls workbook, and then you can do an Alt+F11 to open the code editor, or as you did it, View Code, and delete these lines in the image you attached. They are not doing anything.

    2) Go back into Excel and and use the Windows menu to hide the workbook again.

    3) Go back to the VBE and save the workbook from there.

    That should take care of things for you. If you still need any help, please post a reply.

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

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

    Re: Macros in Book.xlt (97 SR2)

    Depending on what operating system you are using, there can be more than one XLStart folder. Your best bet is to search the system for Book.xlt, and deal with each occurrence you find.

    Possible locations might be found at WindowsApplication DataMicrosoftExcel or ProfilesUsername.... etc.

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

    Re: Macros in Book.xlt (97 SR2)

    That is the dummy macro for the workbook open event. It will always be there if you do a "View Code" on the ThisWorkbook object. It is not created from the Book.xlt or any other template. It is automatically created by XL for all workbooks. If you drop down the event routine list in the right hand combo box and choose a different event, you will find that there is a similar dummy routine there for all of the events. You can't get rid of those.
    Legare Coleman

  5. #5
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros in Book.xlt (97 SR2)

    Wassim -I had looked for Personal.xls and it was not present (was not being loaded).
    Andrew Cronnolly - I used explorer to search all the drives including the network and the file was not present.
    Legare Coleman - You are correct, of course. The dummy macro is generated automatically for the event. <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    The question remains: When I set my Macro Virus Protection On (like the user has) and create a new workbook and save it -upon reopening -it does not cause the macro virus warning to be triggered, whereas when I do the same steps on his PC, the warning is triggered. I know I can just tell him to turn the Macro Virus Protection off, but i would prefer fixing the problem.
    Thanks for the effort,
    Chuck
    Chuck Reimer
    I'm from the Government and I'm here to help...

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

    Re: Macros in Book.xlt (97 SR2)

    What level is the macro security set to, Medium or High? Does the same thing happen on both settings?

    I don't see anything in the screen shot that you posted that should trigger macro security. There would need to be a module or one of the event routines would need to actually include some code. Can you post a workbook that triggers the security on his machine so we can take a look at it.
    Legare Coleman

  7. #7
    3 Star Lounger
    Join Date
    May 2002
    Location
    Mpls, Minnesota, USA
    Posts
    271
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macros in Book.xlt (97 SR2)

    I found IT!
    I do not understand it, but I found it.
    I called the user this morning to update him on progress and during the discussion I realized I was under the wrong impression. It was only ONE file it was happening to, not every file he created. This ruled out the Book.xlt theory I had. I went to his location and did some checking.
    It appears if you access the VBA editor by right clicking the Excel icon (to the left of File on the menu) and selecting View Code, it causes a blank macro to be generated (as shown in original post). If the workbook is saved with this macro still there, it will trigger the Macro Virus Protection Warning (if on).
    If you access the VBA editor using the menu Tools - Macro - Visual Basic Editor, or Alt-F11 it does not cause the blank macro to be generated.

    Thanks for all the suggestions.

    Legare, Your last post asks about the level the macro security is set to (Medium or High). I do not understand the question. The Macro Virus Protection I was referring to is the one set in Tools Options General in Excel 97. Is there another macro security setting?

    Thanks Wassim, Andrew and Legare
    Chuck
    Chuck Reimer
    I'm from the Government and I'm here to help...

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

    Re: Macros in Book.xlt (97 SR2)

    Glad you found it.

    I honestly do not remember how security worked in 97. In XL2K you can set the level to low, medium, or high.
    Legare Coleman

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macros in Book.xlt (97 SR2)

    In Excel 97 you can only turn Protection Against Macro Viruses on or off. "On" just means that the user gets a warning if the workbook contains macros. He/she can then decide to open the workbook with macros activates, with macros deactivated or not open it at all. There are no intermediate levels.

Posting Permissions

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