I have an Excel 2007 spreadsheet that I edit with the OpenXML SDK 2. I remove some rows etc. I would like to know how to save that Spreadsheetdocument to another filename.>
I don't know what version this functionality was introduced, but I use OpenXmlPackage.SaveAs, where
SpreadsheetDocument, is a subclass of OpenXmlPackage.
This function returns the new document, so you can switch to the copied one and apply your changes to it:
void FromTemplate()
{
using var template = SpreadsheetDocument.Open("Template.xlsx", isEditable: true);
using var output = (SpreadsheetDocument)template.SaveAs(path);
//no longer need to keep handle open
template.Dispose();
//apply your changes to package
}