We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert multiple HTML Files into individual worksheets

Hello Aspose Team,

How to write multiple html files into individual worksheets using aspose.cells ? Noticed a way in one of the thread in the year 2018, Export Html string to Worksheet where they gave the workaround to “split your HTML tables into different standalone html files, then you can easily import them into different workbooks, and then copy the data from every sheet to the destination of final workbook”. still is this the way we can able to achieve this or any other solution available in the latest aspose.cells version.

You are right, this is still like this and there is no new API available that can be used to achieve your required output. Please feel free to write us back if you have any other query in this regard.

Thanks for the response.


Yes, you may try this workaround. You may simply save each HTML to individual Excel files. Then, merge all those Excel files in one workbook using Worksheet.Copy or Workbook.Copy method to copy sheet to the final workbook.

Another way can be using MergeFiles static method to merge individual files into one file. See the sample code for your reference.
Sample code:

//Create an Array (length=2)
string[] files = new string[2];
//Specify files with their paths to be merged
files[0] = @"e:\test2\MyBook1.xls";
files[1] = @"e:\test2\MyBook2.xls";
//Create a cachedFile for the process
string cacheFile = @"e:\test2\temporaystoragefile.txt";
//Output File to be created
string dest = @"e:\test2\OutputGrandBook.xls";
//Merge the files in the output file
CellsHelper.MergeFiles(files, cacheFile, dest);

Hope, this helps a bit.