MyXls でファイルを編集しようとしています:
XlsDocument doc = new XlsDocument(InputFilePath);
Worksheet sheet = doc.Workbook.Worksheets[InputSheet.Substring(0, InputSheet.Length - 1)];
foreach (var row in sheet)
{
if (row.CellCount > 1)
{
Cell firstCell = row.GetCell(1);
firstCell.Font.Weight = FontWeight.Bold;
}
}
doc.Save();//Here is a nullreference Exception without any explanations
MyXLs は私のファイルに書き込めないようです。例は、新しいファイルの作成のみです。もしそうなら、このライブラリを使ってある xls ファイルのすべての内容を別のファイルにコピーする最良の方法は何ですか?