Мне нужно создать файл Excel с помощью кода C#.Расширение диапазона рабочих листов Excel
Я делаю это так, что было от Microsoft/MSDN https://msdn.microsoft.com/en-us/library/ms173186(v=vs.80).aspx
рекомендованного На примере MSDN, клетки колеблются фиксировано:
// Select the Excel cells, in the range c1 to c7 in the worksheet.
Range aRange = ws.get_Range("C1", "C7");
if (aRange == null)
{
Console.WriteLine("Could not get a range. Check to be sure you have the correct versions of the office DLLs.");
}
// Fill the cells in the C1 to C7 range of the worksheet with the number 6.
Object[] args = new Object[1];
args[0] = 6;
aRange.GetType().InvokeMember("Value", BindingFlags.SetProperty, null, aRange, args);
Но в моей функции, что я пишу
public void Create ExcelFile(List<string> strList);
Мне нужно увеличить количество строк до количества объектов, которые я получаю в параметре функции List.
Как это сделать?
спасибо.