Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

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

Signature
C#C#
Wiki Markup
{description}
{excerpt}Sets or returns whether ExcelWriter should remove macros from the generated workbook or leave them in when saved. {excerpt}
{signature:C#}
 public boolean ExcludeMacros{ get; set; }
Signature
{signature}{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.

{signature}
{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.
{remarks}
{example}{code:csharp|title=C#}
//--- 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}
{code:vb.net
|title=vb.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")
{code}

{example}
Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle