I have been trying to make a simple app to merge information from one excel spreadsheet to another in c#. But I don't find any reference about how could I do this.
I have the info in one spreadsheet and I need to copy that information in another spreadsheet file.
How can do this? Thanks in advance.
Here is another thing you may want to try out (the code uses GemBox.Spreadsheet library ):
ExcelFile source = ExcelFile.Load("Source.xlsx");
ExcelColumn sourceColumn = source.Worksheets[0].Columns[0];
ExcelFile destination = ExcelFile.Load("Destination.xlsx");
ExcelColumn destinationColumn = destination.Worksheets[0].Columns[0];
int count = source.Worksheets[0].Rows.Count;
for (int i = 0; i < count; i++)
destinationColumn.Cells[i].Value = sourceColumn.Cells[i].Value;
destination.Save("Destination.xlsx");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.