I'm writing some code for my NopCommerce webshop, that needs to export an excel sheet.
I'm trying to edit the width of the columns, so the text will fit in. I already tried the following code(for 26 columns):
//adjust excel column width
for (int i = 0; i < 26; i++)
{
worksheet.Column(i, 1).Width = 45;
}
The code executes and the Width of the columns is 45, so you could say it works. But it gives me the following error at start up:
How can I get rid of this error?
Thanks in advance!