Frage

Does the excel file have to be xlsm for the worksheet_change event to work, or can this be done in xlsx. I fear it's only xlsm. Although it seems like a small thing, asking some co-workers to select 'enable macros' seems to be too much to ask

War es hilfreich?

Lösung

From http://msdn2.microsoft.com/en-au/library/aa338205.aspx#office2007aboutnewfileformat_introduction

Macro-Enabled Files vs. Macro-Free Files

Default 2007 Microsoft Office system documents saved in Office XML Formats are intended to be macro-free files, and therefore cannot contain code. This behavior ensures that malicious code, residing in a default document, can never be executed unexpectedly. While 2007 Microsoft Office system documents can still contain and use macros, the user or developer must save these documents as a macro-enabled document type.

Basically the idea of xlsx vs xlsm is that user can tell straight away if there is code in a worbook or not, so if you want to put code in your workbook you must save it as xlsm.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top