Copying worksheets across workbooks

B

Bala Venkat

Hi - I'm trying to copy a work sheet from a excel file to another excel file
using C#. The code I use is as follows:

---

((Microsoft.Office.Interop.Excel.Worksheet)(dataApp.ActiveWorkbook.Sheets[1]
)).Copy( excelApp.ActiveWorkbook.Sheets[10],
System.Reflection.Missing.Value );

---

dataApp is the ExcelApplicationClass that I use to open the excel sheet that
has the data and excelApp has my target workbook.

I get the following error on Executing the code.

"Exception from HRESULT: 0x800A03EC"

Any help in this regard will be useful!

Thanks,

Bala
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top