Hello,
I am using the XlsIO library(24.1400.41.0) to create an Excel file:
Excel Engine excel Engine = new Excel Engine();
Application application = excel Engine.Excel;
application.Default Version = Excel Version.Excel 2010;
Workbook workbook = application.Workbooks.Create(1);
I also add photos to the cells in the comment field:
Image _image = Image.FromStream(stream);
double kf = 1;
if (_max Pic Height < _image.Height) kf = (double)_image.Height / _maskheight;
worksheet.Range["F" + _A.ToString()].AddComment().Height = (int)(_image.Height / kf);
worksheet.Range["F" + _A.ToString()].AddComment().Width = (int)(_image.Width / kf);
worksheet.Range["F" + _A.ToString()].Add Comment().Fill.UserPicture(_image, "Image.jpg");
All this happens without errors.
But when I try to save a file:
workbook.SaveAs(@"C:\Users\admin\Desktop\ms_res.xslx");
I get an error:
The index is out of range. The index must be a positive number, and its size must not exceed the size of the collection.Parameter name: index
This error does not occur with all lines, but I cannot understand why it appears.
How do I understand exactly what the error is and in what kind of situation it occurs?
Attachment:
stack_trace_7780f11b.zip