Thank you very much for quick response!
I have one input file and I need to produce lots of output files with different values. But I don't want each time read input file from disk. I want smth like:
- 1. read original workbook from file
- 2. copy original to current
- 3. populate current with data
- 4. save current to file
And I need repeat 2-4 many times. So your solution is not very suitable in this situation.
I created empty Book in Excel and tried to copy it like this:
- Code: Select all
var original = new Workbook();
original.LoadFromFile("Book1.xlsx");
var target = new Workbook();
using (var stream = new MemoryStream())
{
original.SaveToStream(stream, FileFormat.Version2010);
stream.Seek(0, SeekOrigin.Begin);
target.LoadFromStream(stream);
}
But it doesn't work. I get ArgumentNullException.
Do you have another suggestions about how I can do this?
Thank you