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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve

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

    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.Unauthor izedAccessExcep tion


    Here is my codes:

    71: // Start a new workbook in Excel.
    72: m_objExcel = new Excel.Applicati on();
    73: m_objBooks = (Excel.Workbook s)m_objExcel.Wo rkbooks;
    74: m_objBook = (Excel._Workboo k)(m_objBooks.A dd(m_objOpt));



  • Steve C. Orr [MVP, MCSD]

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

    This article demonstrates a number of techniques for generating Excel and
    Word documents.
    ITProToday.com is a leading online source of news, analysis and how-to's about the information technology industry.


    Here's a good 3rd party product you could use if you need to get really
    fancy:

    And here's another:
    OfficeWriter is a .NET library for generating, reading, and manipulating XLS, XLSX, DOC,DOCX formats and SSRS in .NET code


    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP



    "Steve" <Steve@discussi ons.microsoft.c om> wrote in message
    news:9816FDA7-0B81-45EB-A3B5-C8B908D38FDF@mi crosoft.com...[color=blue]
    >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.Unauthor izedAccessExcep tion
    >
    >
    > Here is my codes:
    >
    > 71: // Start a new workbook in Excel.
    > 72: m_objExcel = new Excel.Applicati on();
    > 73: m_objBooks = (Excel.Workbook s)m_objExcel.Wo rkbooks;
    > 74: m_objBook = (Excel._Workboo k)(m_objBooks.A dd(m_objOpt));
    >
    >
    >[/color]


    Comment

    Working...