Enable macro execution in Excel
Symptoms
The Excel Table Reader example will not work properly if macro execution is disabled (which is the default setting in a fresh install of Excel).
Cause
To protect users against malicious code, execution of macros is disabled by default in all recent versions of Microsoft Office.
Depending on the security settings, the user will either be asked when opening a document with macros whether they should be executed or not (Security level: Medium), or not prompted at all (Security level: High).
Solution
To be able to execute macros and to run the example, the security settings must be set to Medium (recommended) or Low (not recommended for security reasons). The exact procedure how to do this depends on the Office version used, and is described in the Microsoft Help:
- Changing macro security settings in Office XP / 2002
- Changing macro security settings in Office 2003
- Enable or disable macros in Excel 2007 and 2010
After setting the security level to Medium, allow macro execution with the prompt appearing after opening the document. If this prompt does not appear, or if you accidentally disallowed macro execution, close the document and open it again.