Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

Sets or returns whether ExcelWriter should remove macros from the generated workbook or leave them in when saved.

Signature
C#
C#
 public boolean ExcludeMacros{ get; set; }
Signature
vb.net
vb.net
Public Property ExcludeMacros() As Boolean
Remarks

By default this property is false, and setting it to false has no effect on the output.
This property has no effect until Save is called, at which point the macros will be permanently removed from the workbook if it is true.
If the workbook originally did not have any macros, this property has no effect.

Example
Code Block
csharp
csharp
titleC#
//--- Get the ExcludeMacros value for the workbook
bool exclude = wb.ExcludeMacros;
//--- Set the ExcludeMacros value for the workbook
wb.ExcludeMacros = true;
//--- Save a new version with no macros
wb.Save("output.xlsx")
Code Block
vb.net
vb.net
titlevb.net
'--- Get the ExcludeMacros value for the workbook
Dim exclude As Boolean = wb.ExcludeMacros

'--- Set the ExcludeMacros value for the workbook
wb.ExcludeMacros = True
'--- Save a new version with no macros
wb.Save("output.xlsx")