Excel 2007: Macros not working in password-protected workbooks

R

rfooks

Hello:

I am creating Excel 2007 workbooks from Access VBA using an Excel
template (.xlsm) containing macros. When I create the workbooks w/o
applying password-protection to the Excel files, the macros run as
they are supposed to. However, when I save the .xlsm workbook with a
password, the macros do not run when I open the workbooks.

When I open the workbook, remove the password, and then close it..the
macros WILL run when I reopen the workbook. They don't run in a
password-protected workbook.

I have the 'Enable All Macros' option set in Trust Settings

Is this a known problem with Excel 2007??

Thanks,

Rick
 
J

Jim Rech

When a password protected workbook is opened in Excel 2007 macros are
automatically disabled, presumably because the macros cannot be scanned due
to the file being encrypted.

Setting this dword registry key to 1 will turn that feature off:

HKCU\Software\Microsoft\Office\12.0\Excel\Security\ExcelBypassEncryptedMacroScan
 
R

rfooks

Hello:

I am creating Excel 2007 workbooks from Access VBA using an Excel
template (.xlsm) containing macros. When I create the workbooks w/o
applyingpassword-protection to the Excel files, the macros run as
they are supposed to. However, when I save the .xlsm workbook with apassword, the macros do not run when I open the workbooks.

When I open the workbook, remove thepassword, and then close it..the
macros WILL run when I reopen the workbook. They don't run in apassword-protected workbook.

I have the 'Enable All Macros' option set in Trust Settings

Is this a known problem with Excel 2007??

Thanks,

Rick

Thanks, Jim. I will give this a try.

Can that registry setting be accessed and changed programmatically??

Rick Fooks
 

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