Workbook_Open() fails to open

Copper Contributor

I built a macro that uses the function Workbook_Open() and then executes stuff which, as I understand it, should kick off as soon as the spreadsheet it opened.  I've saved the spreadsheet as .xlsm and I can run the macro manually but it doesn't run itself when the spreadsheet is opened.  I think the spreadsheet was originally created using 2003 and I'm using it in 2010.  Could that be the problem?  

2 Replies
Hello! Pls. Check your security options in that workbook. Go to „File“-Tab—Options— Trust Center. There you can check it. If macro options grayed out, you don’t have permission to change it. Greets, Eva

Some other ideas;

 

Make sure the sub is within the "ThisWorkbook" module and called exactly "Private Sub Workbook_Open()". Not in another module, form, worksheet, or class, and obviously on the correct workbook.


"Application.EnableEvents = False" turns off events. If this is ran on another workbook it will stop your workbook from running it's "Workbook_Open". Make sure this is on.

"Workbook_Open" still needs macros to be enabled to run. The trust center options defines how these act but as best practice should be set to always warning. There are further additions from a development end to make sure there is a "splash screen" so the user can not use the tool till macros are enabled if need be.

Hope one of these help?

Alistair Blades - BespokeExcel

 

@JIM SNYDER