ArgumentException at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.Theme.SystemColorElement.GetColor(IOpenXmlImportContext context)
The problematic value is val="windowText"
When an xlsm file is imported and then exported, a new ThisWorkbook object is created in the VBA browser. This creates issues when making VBA functions that have to be executed upon opening of the file.
Applying text format to a column also sets the format to the next column.
This happens when the columns have a size different from the default and two consecutive columns with different format also have the same size. This can be worked around with a slight change in the column sizes:
int columnCount = worksheet.UsedCellRange.ColumnCount;
for(int i = 1; i < columnCount; i++)
{
ColumnWidth colWidth = worksheet.Columns[i].GetWidth().Value;
if(colWidth.Value != SpreadsheetDefaultValues.DefaultColumnWidth)
{
ColumnWidth previousColWidth = worksheet.Columns[i - 1].GetWidth().Value;
if(colWidth.Equals(previousColWidth))
{
worksheet.Columns[i].SetWidth(new ColumnWidth(colWidth.Value + 1, colWidth.IsCustom));
}
}
}
When a file uses shared formulas, if the cell references are not explicitly written in the cell element, the formulas will not be shown correctly. This will manifest like a file that has a succession of slightly differing formulas in Excel and in RadSpreadsheet or RadSpreadProcessing they will be a succession of the same formula instead.