Hi Luis,
Thanks for the update.
To open the existing workbook, close then open a another workBookYou can open existing workbook using the Open method of Workbook object. Please refer the below code snippet to do so.
[VB] 'Step 1 : Instantiate the spreadsheet creation engine.
Dim excelEngine As ExcelEngine = New ExcelEngine()
'Step 2 : Instantiate the excel application object.
Dim application As IApplication = excelEngine.Excel
'Open the existing workbook
Dim workbook As IWorkbook = application.Workbooks.Open("..\..\Book1.xls")
'The first worksheet object in the worksheets collection is accessed.
Dim sheet As IWorksheet = workbook.Worksheets(0)
'Inserting sample text into the first cell of the first worksheet.
sheet.Range("B1:N30").Text = "Hello World"
'Saving the workbook to disk.
workbook.SaveAs("Sample.xls")
'Close the workbook.
workbook.Close()
'Open the another workbook
workbook = application.Workbooks.Open("..\..\Book2.xls")
sheet = workbook.Worksheets(0)
'Saving the workbook to disk.
workbook.SaveAs("Sample1.xls")
'Close the workbook.
workbook.Close()
Please download the sample from the below location:
http://websamples.syncfusion.com/samples/XlsIO.Windows/P41019_3/main.htm Please let me know if you need any further assistance.
Best Regards,
Bhuvana