+ Reply to Thread
Results 1 to 8 of 8

Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows 7

  1. #1
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows 7

    Hi,

    Bit of a strange one this that I can't find an answer to and wondering if anyone here has come across it before.

    Until recently I was using Windows XP with Excel 2003.
    I have several Workbooks with Macro's that open other workbooks to retrieve data. One of these actually calls the macro's within the other workbook (to update figures) before retrieving data.

    I understand the basic principle of security settings (set to medium) that you cannot bypass the "Enable/Disable Macro" option for obvious reasons. HOWEVER, I never questioned it at the time, but if the main workbook is opened with Macro's enabled, when it opens the source workbooks, the macros are automatically enabled and no warning message shows. Therefore I've happily coded away and thought nothing of it.

    Last week I was migrated (at work) to Windows 7, but have remained using Excel 2003.
    Now, when I open the same workbook and run the macro - the "Enable/Disable Macro" option is displayed each time an underlying source workbook is opened. This obviouly halts the code and throws out errors if the user clicks on disable - so I need to find a workaround.

    I checked macro security settings in Excel - both at Medium.
    Investigated using Digital Certificates - only works for one user so cannot be rolled out to all users and the trusted users list is locked down.
    I even tried just to surpress the message and leave macros disabled in the source workbooks but this doesn't work either. Code used:

    Please Login or Register  to view this content.
    ...then set to true after opening. Nope, the "Enable/Disable Macro" option still pops up.

    Does anyone have any ideas why this is happening - what to check - or how to workaround (e.g error handling if not enabled).

    Argh! Driving me crazy!

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    sounds like automationsecurity may be set-perhaps
    Please Login or Register  to view this content.
    is needed at the start of your code
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    Hi JosephP,

    Thanks for coming back on this. Unfortunately Low Secutiry is not an option in this case.Too risky to be justified and it's locked to Medium as the lowest setting anyhow.

    What's strange is Medium in XP didn't trigger the message but it does in Windows 7 - also that I cannot surpress the message and automatically disable macros... If I could do that at least I could keep the code running and work around it...

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    automationsecurity is not the same as the macro security setting you set in the ui. it is only related to the security setting while running code. did you test what I suggested?

  5. #5
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    Appologies I made an assumption there! Won't do that again...

    It does indeed work - you are a wonderful wonderful person and posibly the saviour of my sanity!!! Thank you kindly.

  6. #6
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    Just wondering - do I need to reset back to Medium / default settings before exiting the code?

    Guess it does this automatically but is it best in terms of performance / etiquette?

  7. #7
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    the default is actually supposed to be low so I reckon you may have a group policy changing that. I suggest you store the current value in a variable, set to low, open the workbook, then reset to the original value

  8. #8
    Forum Contributor
    Join Date
    10-22-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    162

    Re: Enable / Disable Macros behaving differently in Excel 2003 from Windows XP to Windows

    Okay will do. Thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1