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

Discussion in 'ASP .Net' started by Guest, Aug 12, 2004.

  1. Guest

    Guest 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));
     
    Guest, Aug 12, 2004
    #1
    1. Advertisements

  2. Steve C. Orr [MVP, MCSD], Aug 12, 2004
    #2
    1. Advertisements

  3. Guest

    MDeLeon

    Joined:
    Dec 5, 2010
    Messages:
    1
    Likes Received:
    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.
     
    MDeLeon, Dec 5, 2010
    #3
  4. Guest

    ketanerp

    Joined:
    Oct 13, 2011
    Messages:
    1
    Likes Received:
    0
    ketanerp, Oct 13, 2011
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.