'C# programmatically open xls (Excel 97-2003) as xlsx (Excel 2007)

i want to open with C# programmatically an .xls file, my code:

excelApp.Workbooks.Open(pathXls);

After that i try to move the opend Workbook with:

activeWorksheet.Move(After:workbookTwo.Worksheets[1]);

With this code this exeption message shows up:

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

How can i move an xls in an xlsx excel-App. Could need some help here

I tried excelApp.Workbooks.OpenText(pathXls) but did not worked. Also i tried to Copy the Workbook but it also did not helped.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source