Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. [Help]How to open a Excel file with Asp.net(C#)!

[Help]How to open a Excel file with Asp.net(C#)!

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tuliplanetrain
    wrote on last edited by
    #1

    :((i mean how to active office excel to open it(if suppose user have already installed),not to open it with IE! Tuliplanet

    J T 2 Replies Last reply
    0
    • T tuliplanetrain

      :((i mean how to active office excel to open it(if suppose user have already installed),not to open it with IE! Tuliplanet

      J Offline
      J Offline
      John Kuhn
      wrote on last edited by
      #2

      Warning: Microsoft says that Microsoft Excel is not intended to be used with multi-threaded applications, and ASP.NET is a multi-threaded application. That being said, if you must open a Microsoft Excel worksheet, first, add a reference to your project to the COM library "Microsoft Excel 9.0 Object Library". Then, within your code:

      Excel.Application xl = new Excel.Application();
      xl.Workbooks.Open("book1.xls");

      What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.

      1 Reply Last reply
      0
      • T tuliplanetrain

        :((i mean how to active office excel to open it(if suppose user have already installed),not to open it with IE! Tuliplanet

        T Offline
        T Offline
        Thea Burger
        wrote on last edited by
        #3

        You can also add the following to your page declaration: contenttype="application/vnd.ms-excel", or in you code-behind file use Response.ContentType="application/vnd.ms-excel"; There is a good example here: http://www.dotnet247.com/247reference/msgs/26/132455.aspx This really works well!! -Thea-

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups