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));
 
Joined
Dec 5, 2010
Messages
1
Reaction score
0
Creating Excel files without Office

If you're trying to make Excel files on the server (without installing Office) then give my API a try: ClosedXML.CodePlex.com

Right now it's fairly robust but I want to get more feedback to keep improving it.
 

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

Members online

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top