Macros disabled, not by security settings?

D

DS

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...
 
D

DS

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
 
M

Martin Brown

DS said:
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
 
D

DS

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
 
M

Martin Brown

MikeC said:
Martin said:
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
 
M

Martin Brown

MikeC said:
Martin Brown;613382 Wrote:

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top