Create and save data to an Excel file with C#.net

G

Guest

I am trying many ways to create and save data to an Excel file, but all I got
is the following error message. (The code behind is in C#.net)

System.UnauthorizedAccessException


Here is my codes:

71: // Start a new workbook in Excel.
72: m_objExcel = new Excel.Application();
73: m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;
74: m_objBook = (Excel._Workbook)(m_objBooks.Add(m_objOpt));
 

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