NativeExcel2 for .Net Developer's Reference

IWorkbook.ClearVBAMethod

Removes preserved VBA block from the workbook.

[Visual Basic]
SubClearVBA()
[C#]
voidClearVBA();
[C++]
voidClearVBA();
[JScript]
functionClearVBA();

Example

This example removes VBA block from the modified workbook.

[C#]
IWorkbook book = Factory.OpenWorkbook("book.xls");
if (book != null) {
   book.ClearVBA();
   book.SaveAs("book2.xls");  
} 

See Also

IWorkbook Interface | NativeExcel Namespace