562 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Event-handling macros in Excel Visual Basic
Part four of a five-part series of blogs
Want to do something when a user opens a workbook, or stop them clicking on a particular cell? You need to learn how to attach code to Excel workbook or worksheet events!
Sadly (for you, as a developer) it is easily possible to bypass macros which run automatically.
When you open up any workbook containing macros, if your security level is set to Medium (the default and most sensible value), you'll see a message like this:
A typical dialog box when you open a workbook containing macros.
If your user chooses the default button to disable macros, there's not much you can do about it!
An alternative way to bypass macros is by holding down the SHIFT key just at the point that you're about to open a file.
If you're distributing your workbook to clients, colleagues or other third parties, there are various solutions to this problem - but none is that satisfactory:
You can ask them nicely to enable macros in your workbook.
You can copy the workbook into a trusted folder (but you'll need to have administrator rights to their machine to do this).
You can digitally sign the macro (but the recipient will still be able to refuse to accept it).
Basically, there is no way of forcing a third party to run your macros - which if you think about it is as it should be!
|Parts of this blog|
25 Aytoun Street