1

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.

enter image description here

I have the info in one spreadsheet and I need to copy that information in another spreadsheet file.

enter image description here

How can do this? Thanks in advance.

Lanshore
  • 43
  • 1
  • 1
  • 9

1 Answers1

1

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");
Phouttrat
  • 24
  • 2