![]() |
Macros disabled, not by security settings?
Good morning all,
Using Excel 2K7. I have a workbook with a bunch of forms and code in it. When opening this workbook, the macros are disabled by default (no warning). The Macro Security Settings are currently set to "Enable All" and other workbooks allow macros to run. When selecting the macros dialogue box (with the Run/Edit/Step Into etc options) the macros in the workbook show their "full" name (e.g. including workbook name, module & macro name). Attempting to run results in the error message "Because of your security settings, macros have been disabled.." and advises me to change the security level. Everything I see against this workbook is what I would normally see if I had the security settings set to Disable All Without Warning. I have tried changing the security settings to Disable All and then back to Enable All, and it doesn't resolve the matter. Just to make things even more interesting, if I open a different workbook with code in it, even in the same instance of the Excel Application that has the problem wb open in it, macros are enabled in the second workbook, but remain disabled in the problem wb! Any suggestions would be gratefully received... |
Macros disabled, not by security settings?
SOLVED:
Using a Windows 7 / Office 2K7 combination, if the workbook is password-protected, the file cannot (apparently) be scanned to confirm that the code is "safe". Therefore it's prevented from running. Solution? Unprotect the wb, code runs fine, exactly as it should. Also works fine if protected write access only, in both read and write modes. Significantly less than ideal, to say the least. If anyone has any other suggestions on this, I would be profoundly grateful to hear them. It would be nice to use both the password feature and code...! Cheers, DS "DS" wrote: Good morning all, Using Excel 2K7. I have a workbook with a bunch of forms and code in it. When opening this workbook, the macros are disabled by default (no warning). The Macro Security Settings are currently set to "Enable All" and other workbooks allow macros to run. When selecting the macros dialogue box (with the Run/Edit/Step Into etc options) the macros in the workbook show their "full" name (e.g. including workbook name, module & macro name). Attempting to run results in the error message "Because of your security settings, macros have been disabled.." and advises me to change the security level. Everything I see against this workbook is what I would normally see if I had the security settings set to Disable All Without Warning. I have tried changing the security settings to Disable All and then back to Enable All, and it doesn't resolve the matter. Just to make things even more interesting, if I open a different workbook with code in it, even in the same instance of the Excel Application that has the problem wb open in it, macros are enabled in the second workbook, but remain disabled in the problem wb! Any suggestions would be gratefully received... |
Macros disabled, not by security settings?
Two things to try 1) See if there are any Class modules. 2) Search for the error message in VBA and check the option to look in entire Project (default is current module). -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170364 Microsoft Office Help |
Macros disabled, not by security settings?
DS wrote:
SOLVED: Using a Windows 7 / Office 2K7 combination, if the workbook is password-protected, the file cannot (apparently) be scanned to confirm that the code is "safe". Therefore it's prevented from running. Solution? Unprotect the wb, code runs fine, exactly as it should. Also works fine if protected write access only, in both read and write modes. It can't be that. I have a number of generic spreadsheets that will run on any version of Excel and all are password protected. You may have to put them in a trusted location and adjust trust centre settings accordingly, but XL2007 will permit password protected macros to run. Regards, Martin Brown Significantly less than ideal, to say the least. If anyone has any other suggestions on this, I would be profoundly grateful to hear them. It would be nice to use both the password feature and code...! Cheers, DS "DS" wrote: Good morning all, Using Excel 2K7. I have a workbook with a bunch of forms and code in it. When opening this workbook, the macros are disabled by default (no warning). The Macro Security Settings are currently set to "Enable All" and other workbooks allow macros to run. When selecting the macros dialogue box (with the Run/Edit/Step Into etc options) the macros in the workbook show their "full" name (e.g. including workbook name, module & macro name). Attempting to run results in the error message "Because of your security settings, macros have been disabled.." and advises me to change the security level. Everything I see against this workbook is what I would normally see if I had the security settings set to Disable All Without Warning. I have tried changing the security settings to Disable All and then back to Enable All, and it doesn't resolve the matter. Just to make things even more interesting, if I open a different workbook with code in it, even in the same instance of the Excel Application that has the problem wb open in it, macros are enabled in the second workbook, but remain disabled in the problem wb! Any suggestions would be gratefully received... |
Macros disabled, not by security settings?
Hi Joel,
1. No Class modules 2. Not sure what you mean by searching for the error message throughout the project. The error message presented is an Excel error message indicating that the macros are disabled, rather than a VBA error type. Had a quick look at the links provided. On the first, Martin Brown states quite confidently that "it can't be that". As I'm not registered on CodeCage, I can't reply directly, but I can assure that it "is that". Adding a full password stops all code in the workbook, taking the password off again allows them to function correctly. According to a post on RDB's site, it's not a consistent problem, but does occur - his suggested solution involves editing the registry to bypass the issue. http://www.rondebruin.nl/password2007.htm The 2nd link provided returns a 404. Cheers, DS "joel" wrote: Two things to try 1) See if there are any Class modules. 2) Search for the error message in VBA and check the option to look in entire Project (default is current module). -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170364 Microsoft Office Help . |
Macros disabled, not by security settings?
Martin Brown;613260 Wrote: [color=blue] DS wrote: It can't be that. I have a number of generic spreadsheets that will run on any version of Excel and all are password protected. You may have to put them in a trusted location and adjust trust centre settings accordingly, but XL2007 will permit password protected macros to run. Hi Martin, thanks for your response. It does seem that it *is* that, though it seems as though it's not a consistent issue. I've never come across it before in any flavour of OS / Office combination. The Trust Centre was the first thing I checked. I tried the following with the wb in question, making no other changes: Password present - no code will run. Remove Password - code will run fine. Re-add password - no code will run Remove Password - code will run fine Add R/W Password - code will run fine in both Read Only and full access modes. Add full password - no code will run Remove all passwords - code runs fine I've found an article by Ron deBruin about the matter. His method of dealing with it involves registry editing to allow the password / code run to remain together, and notes that it isn't consistent. 'Macros are disabled when you open password protected workbooks' (http://www.rondebruin.nl/password2007.htm) Cheers, MikeC -- MikeC ------------------------------------------------------------------------ MikeC's Profile: 1386 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170364 Microsoft Office Help |
Macros disabled, not by security settings?
MikeC wrote:[color=blue]
Martin Brown;613260 Wrote: DS wrote: It can't be that. I have a number of generic spreadsheets that will run on any version of Excel and all are password protected. You may have to put them in a trusted location and adjust trust centre settings accordingly, but XL2007 will permit password protected macros to run. Hi Martin, thanks for your response. It does seem that it *is* that, though it seems as though it's not a consistent issue. I've never come across it before in any flavour of OS / Office combination. The Trust Centre was the first thing I checked. I tried the following with the wb in question, making no other changes: Password present - no code will run. Remove Password - code will run fine. Re-add password - no code will run Remove Password - code will run fine Add R/W Password - code will run fine in both Read Only and full access modes. Add full password - no code will run Remove all passwords - code runs fine I've found an article by Ron deBruin about the matter. His method of dealing with it involves registry editing to allow the password / code run to remain together, and notes that it isn't consistent. 'Macros are disabled when you open password protected workbooks' (http://www.rondebruin.nl/password2007.htm) Now you have me worried. It may be only a matter of time before my protected macros worksheets will run into copies of XL2007 that fail to run password protected code. I checked in REGEDIT I do not have any patches in place to override. About identifies my current patch level of XL2007 SP2 as Excel 12.0.6514.5000 SP2 MSO (12.0.6525.1000) (shame you cannot cut and paste that string) Was your iffy workbook created in XL2007 from scratch or in a previous version and ported to XL2007. Mine are all ported from XL2002 or before. Clutching at straws here, but it would be useful to understand what the root cause is I don't like hacking the registry with a flint axe. Or worse still having to instruct end users how to do it over the phone. Can you create a minimal failing case that gives away no trade secrets? Thinking about it I have seen something like this happen when I double click on a version that has been autosaved after a fatal crash in Excel (which sadly is all too common in XL2007). Regards, Martin Brown |
Macros disabled, not by security settings?
Martin Brown;613382 Wrote: [color=blue] MikeC wrote: Now you have me worried. It may be only a matter of time before my protected macros worksheets will run into copies of XL2007 that fail to run password protected code. I checked in REGEDIT I do not have any patches in place to override. About identifies my current patch level of XL2007 SP2 as Excel 12.0.6514.5000 SP2 MSO (12.0.6525.1000) (shame you cannot cut and paste that string) Was your iffy workbook created in XL2007 from scratch or in a previous version and ported to XL2007. Mine are all ported from XL2002 or before. Clutching at straws here, but it would be useful to understand what the root cause is I don't like hacking the registry with a flint axe. Or worse still having to instruct end users how to do it over the phone. Can you create a minimal failing case that gives away no trade secrets? Thinking about it I have seen something like this happen when I double click on a version that has been autosaved after a fatal crash in Excel (which sadly is all too common in XL2007). Regards, Martin Brown Hi Martin, I created this wb in 2k7. I've never come across this issue before, and the wb in question was working just fine in a Vista / Office 2K7 combination - the problem occurred when using a Windows 7 / Office 2k7 combo - after weeks of complaining to replace Vista with W7, the first time I try and do anything it won't work! I'm currently running 2k7 12.0.4518.1014, MSO (12.0.6036.5000), so it seems like I'm quite a way behind you at the moment - you never know, it might have been addressed in some of the intervening updates. The wb has minimal non-VBA content, just a couple of reference sheets with no more than 50 populated cells (no formulae) on each. The code being used throughout isn't anything "special". There's nothing more advanced than some basic validation of content and some low-level mathematical calculations (averages of multiple entries etc). Certainly nothing that I would expect to cause "suspicion" in a security program or similar (ie there's nothing creating, editing or deleting files in sensitive locations, launching separate applications etc). The particularly strange thing is that I can open this document (when password-protected) and no macros will be enabled. I can then open a separate wb through the same instance of Excel which is not password protected, and macros will be enabled in that wb within the same instance... I've never come across that before! Like you, I'm not keen on the idea of doing anything with the registry in order to bypass this "feature", which is why I'm going to use a combo where if VBA is enabled it will kick out anyone but me, and if it isn't, it will go only to the placeholder which has no functionality (ie needs to have VBA available in order to open properly). Having done some further testing, I find that creating a new wb with a 1-module content of a MessageBox.Show, adding a password will cause the same effect. I have attached the file I've just tried (password is "PASSWORD"). It would be interesting to see if you can open it with macros working - I can't. You mention that you're using ported wbs from 2k2 - I wonder if this might have some relevance. The ones I'm encountering difficulty with have been created in 2k7 as .xlsm wbs. Cheers, Mike +-------------------------------------------------------------------+ |Filename: Book1.xlsm | |Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=413| +-------------------------------------------------------------------+ -- MikeC ------------------------------------------------------------------------ MikeC's Profile: 1386 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170364 Microsoft Office Help |
Macros disabled, not by security settings?
You can copy regedit entries by going to the menu Edit - Copy Key Name. The actual value can be copied if you select the key name and then go to menu Edit - Modify and copy from the edit box. Here is one that I copied C:\Program Files\Altiris\ALTIRIS AGENT\Agents\PatchMgmtAgent\Languages\0410\PatchMg mtAgentsUI.dll -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170364 Microsoft Office Help |
Macros disabled, not by security settings?
MikeC wrote:
Martin Brown;613382 Wrote: Can you create a minimal failing case that gives away no trade secrets? Thinking about it I have seen something like this happen when I double click on a version that has been autosaved after a fatal crash in Excel (which sadly is all too common in XL2007). Hi Martin, I created this wb in 2k7. I've never come across this issue before, and the wb in question was working just fine in a Vista / Office 2K7 combination - the problem occurred when using a Windows 7 / Office 2k7 combo - after weeks of complaining to replace Vista with W7, the first time I try and do anything it won't work! Wind7 could be the important factor. I haven't run into a copy yet. I'm currently running 2k7 12.0.4518.1014, MSO (12.0.6036.5000), so it seems like I'm quite a way behind you at the moment - you never know, it might have been addressed in some of the intervening updates. I doubt it. I have been working on XL2007 (and muttering about its glacial slowness at charts) since it was introduced and through all the intervening patch levels (and some prerelease ones too). Having done some further testing, I find that creating a new wb with a 1-module content of a MessageBox.Show, adding a password will cause the same effect. I have attached the file I've just tried (password is "PASSWORD"). It would be interesting to see if you can open it with macros working - I can't. You mention that you're using ported wbs from 2k2 - I wonder if this might have some relevance. The ones I'm encountering difficulty with have been created in 2k7 as .xlsm wbs. Cheers, Mike +-------------------------------------------------------------------+ |Filename: Book1.xlsm | |Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=413| +-------------------------------------------------------------------+ Unfortunately, the webpage won't let me in without registering and I am not inclined to do that. My strange looking reply-to address is valid if left unmodified. Just email me a copy of the offending spreadsheet and I will happily take a look at it to see if it fails here. Regards, Martin Brown |
All times are GMT +1. The time now is 04:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com