Hi there,
I using the following code snippet to remove macro from xlt file.
using(var inStream = new FileStream(inputXltFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
{
var opt = new LoadOptions
{
MemorySetting = MemorySetting.MemoryPreference
};
var workbook = new Workbook(inStream, opt);
try {
if(workbook.HasMacro)
{
workbook.RemoveMacro();
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
With Apsose Cells 19.2, the macro can be removed successfully. But with Aspose Cells 19.7, it throw an exception with message ‘Object reference not set to an instance of an object.’.21a97c8227ac49929ca33a7ae7888dd8.zip (71.5 KB)