I need to combine sheets from different Excel sources into a single workbook: open a saved Excel workbook, grab a worksheet and put it into the spreadsheet control, do some manipulation. Then open a different Excel workbook, grab another worksheet and add it as a new worksheet in the spreadsheet control's active workbook. Then save the spreadsheet control's active workbook under a new name. I can't seem to figure out if this is possible, or if so, how to do it.
I can add a new worksheet to the active workbook, but it's empty. I can't seem to set it to another worksheet loaded from a different Excel file. I can copy values row by row and column by column, then then I lose all formatting, merges, etc.
Please let me know if I what I'm attempting is possible.
Thanks.
Hello,
I will look into whether it is possible to accomplish this with our toolset. I think it will be possible to accomplish with minimal code as long as the worksheets stay separate. However, I will need to do some research to determine if this is the case.
I will follow up with my progress, as well as a code snippet or sample application should this be feasible to implement.
Please let me know if you have any questions.
It is possible to do this by looping through the rows and cells in one workbook and adding them to the second. You can also solve it using Excel Interop.
The sample code is provided on this thread: https://www.infragistics.com/community/forums/t/83297.aspx
The thread combines two worksheets into one, but the code should be easy to adapt to adding a new worksheet instead. Please let me know if you have any questions.