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

Discussion in 'ASP .Net' started by =?Utf-8?B?U3RldmU=?=, Aug 12, 2004.

  1. 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));
    =?Utf-8?B?U3RldmU=?=, Aug 12, 2004
    #1
    1. Advertising

  2. This article demonstrates a number of techniques for generating Excel and
    Word documents.
    http://www.aspnetpro.com/NewsletterArticle/2003/09/asp200309so_l/asp200309so_l.asp

    Here's a good 3rd party product you could use if you need to get really
    fancy:
    http://www.aspose.com/Products/Aspose.Word/
    And here's another:
    www.officewriter.com

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "Steve" <> wrote in message
    news:...
    >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));
    >
    >
    >
    Steve C. Orr [MVP, MCSD], Aug 12, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?U3RldmU=?=

    MDeLeon

    Joined:
    Dec 5, 2010
    Messages:
    1
    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. =?Utf-8?B?U3RldmU=?=

    ketanerp

    Joined:
    Oct 13, 2011
    Messages:
    1
    ketanerp, Oct 13, 2011
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arran Pearce

    Re: Save Data to Excel File

    Arran Pearce, Jul 6, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    7,781
    Arran Pearce
    Jul 7, 2004
  2. Anonieko
    Replies:
    2
    Views:
    7,312
    JackStraw73
    Feb 12, 2008
  3. Replies:
    1
    Views:
    1,794
    extentechjohn
    Nov 21, 2006
  4. J'son
    Replies:
    1
    Views:
    560
    Mark Rae [MVP]
    Jan 28, 2008
  5. c676228
    Replies:
    3
    Views:
    344
    Mike Brind [MVP]
    Jul 17, 2008
Loading...

Share This Page