ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2007: Macros not working in password-protected workbooks (https://www.excelbanter.com/excel-programming/397124-excel-2007-macros-not-working-password-protected-workbooks.html)

[email protected]

Excel 2007: Macros not working in password-protected workbooks
 
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


Jim Rech

Excel 2007: Macros not working in password-protected workbooks
 
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

--
Jim
wrote in message
ups.com...
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




[email protected]

Excel 2007: Macros not working in password-protected workbooks
 
On Sep 8, 5:38 pm, wrote:
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



All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com