Free Support Forum - aspose.com

How to convert Microsoft.Office.Interop.Excel Workbook object to Aspose.Cells Workbook object?

Hi,

I have to get the current object instance of the Excel Workbook opened. I have created an excel plugin(VSTO) using C#.Net. I am able to get the current excel workbook object using Microsft.Interop.Excel workbook object. After getting the object instance, i want to change it to Aspose.Cells Workbook object. I tried to do the following casting, but it failed.

Aspose.Cells.Workbook apWorkbook = new Aspose.Cells.Workbook();
apWorkbook = (Aspose.Cells.Workbook)Microsoft.Office.Interop.Excel.Application.ActiveWorkbook;

Please help in converting the MS Office Interop Excel Workbook object to Aspose.Cells Workbook object.

Thanks,
Joe

Is there any other way to get the current instance of excel workbook opened through Aspose.Cells?

Hi Joe,

Well, Aspose.Cells for .NET is an independent spreadsheet management component that does not use, work or reply on Excel’s interoperability API. We have clearly stated on the product page: http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx Aspose.Cells for .NET allows developers to create and manage Excel Spreadsheets without requiring Microsoft Excel or Microsoft Office to be installed on the server or on the client side. So, your desired type of conversion (Microsoft.Office.Interop.Excel Workbook object to Aspose.Cells Workbook) should not possible.


Thanks for your understanding!