You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Hello Forum,
I'd like to open two Excel Workbooks and merge them into one ReoGrid control workbook. Is this the right direction below? I don't know the correct syntax to copy one sheet from one book to another book.
' Open first Excel file into form control (VB.Net)
WorkBook1 = Me.WorkBookControl
WorkBook1.Load("C:/file1.xlsx", IO.FileFormat.Excel2007)
dim WorkSheets1Col as unvell.ReoGrid.WorksheetCollection
WorkSheets1Col = WorkBook1.Worksheets
'Open Second Excel workbook into Memory workbook.
Dim WorkBook2 = ReoGridControl.CreateMemoryWorkbook()
WorkBook2.Load("C:/file2.xlsx", IO.FileFormat.Excel2007)
dim WorkSheets2Col as unvell.ReoGrid.WorksheetCollection
WorkSheets2Col = WorkBook2.Worksheets
' "" copy each sheet from WorkBook2 "After" existing sheets in WorkBook1 ""
WorkSheets2col.CopyTo(WorkSheets1col, 0) ' doesn't work.
What is the actual code for the copy step?
Thank you.
George
Offline
I think you can't merge two workbooks by using CopyTo or CopyWorksheet method. You can try to use worksheet.Clone method to get an instance of worksheet, and add into another workbook.
Sorry for late reply.
Last edited by Jingwood (2016-12-16 09:10:26)
Offline
Pages: 1