Hello, I would like to enquire on a problem as per title. This is my worksheet:
Apparently, if I want to set values to my cells programmatically, I have to do "worksheet = sheet1211.Workbook.Worksheets[0];" every single time within a new method, else nothing will happen, even though worksheet is no longer null.
Example:
const string filePath = @"C:\Users\Secure\Downloads\1211Template.xlsx";
var webClient = new WebClient();
webClient.OpenReadCompleted += (senders, eventArgs) =>
{
var formatProvider = new XlsxFormatProvider();
sheet1211.Workbook = formatProvider.Import(eventArgs.Result);
};
webClient.OpenReadAsync(new Uri(filePath));
sheet1211.VisibleSize = new SizeI(13, 45);
worksheet = sheet1211.Workbook.Worksheets[0];
worksheet.Cells[0, 0, 41, 12].SetFormat(new CellValueFormat("@"));
Apparently, if I want to set values to my cells programmatically, I have to do "worksheet = sheet1211.Workbook.Worksheets[0];" every single time within a new method, else nothing will happen, even though worksheet is no longer null.
Example:
worksheet = sheet1211.Workbook.Worksheets[0];
worksheet.Cells[1, 5].SetValue(DateTime.Parse(issueDate.SelectedDate.ToString()).ToString("ddMMyy"));worksheet = sheet1211.Workbook.Worksheets[0];
worksheet.Cells[currentRow, columnSSN].SetValue(item.SSN);