1
votes

I am trying to merge 12 excel files (each having single excel-sheet) into single consolidated excel file that will have 12 excel-sheets using Microsoft.Office.Interop.Excel liabrary and following error:

"Excel cannot insert the sheets into the destination workbook, because it contains fewer rows and columns than the source workbook. To move or copy the data to the destination workbook, you can select the data, and then use the Copy and Paste commands to insert it into the sheets of another workbook."

I think its related to Microsoft Excel Application's DCOM objects permissions issue.

Can any one explains which type of permission are required to get the services of Microsoft Excel Application using DCOM Object.

Thanks.

1
You're using ASP.NET and Office Interop. This is a bad idea. Don't do it.mason
mason what is your suggestion for doing the above task. Actually implementation is already there in application.Sajid Hussain
Use a library that doesn't depend on Interop, such as EPPlus or NPOI.mason

1 Answers

1
votes

I had this problem in Excel 2013. There was a setting in options, under Save, that created new workbooks as Excel 97-2003 workbooks. I changed this to Excel Workbook and the command started working.