简体   繁体   中英

Create Excel file based on Multiple Excel files C#

I have three Excel Workbooks such as WorkBookA, WorkBookB and WorkBookC. Each workbook which has one sheet such as SheetA, SheetB and SheetC.

I want to create a new excel file with SheetA from WorkBookA, SheetB from WorkBookB and SheetC from WorkBookC.

How to do this? Any suggestions..?

This should be very easy.

  1. Grab some code which reads in a particular worksheet into a DataTable . There are plenty of examples showing how to do this, eg. Excel to DataTable

  2. Create a DataSet containing the three DataTables .

  3. Finally, call my "Export to Excel" library to write this DataSet into a real .xlsx file, Export to Excel

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM