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. How to open an existing excel file (not in the browser) in a new window from ASP.NET 3.5 with C#

How to open an existing excel file (not in the browser) in a new window from ASP.NET 3.5 with C#

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netsysadminwindows-admintutorial
5 Posts 4 Posters 7 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.
  • B Offline
    B Offline
    bnath001
    wrote on last edited by
    #1

    Hello folks,

    I thought this would be very simple. but I am not able to.

    I tried simple code like this using href element. But it tries to open the sheet.xls in the browser window and says it can't find the file. I want the excel file to be opened in excel (not browser). Any suggestions?

    [some excel file](file://domainname/vol1/destinationfiles/sheet.xls)

    The excel file I am trying to open is not on IIS server. It is on file server.
    Thanks much

    nath
    .

    D B 2 Replies Last reply
    0
    • B bnath001

      Hello folks,

      I thought this would be very simple. but I am not able to.

      I tried simple code like this using href element. But it tries to open the sheet.xls in the browser window and says it can't find the file. I want the excel file to be opened in excel (not browser). Any suggestions?

      [some excel file](file://domainname/vol1/destinationfiles/sheet.xls)

      The excel file I am trying to open is not on IIS server. It is on file server.
      Thanks much

      nath
      .

      D Offline
      D Offline
      dusty_dex
      wrote on last edited by
      #2

      Where do you expect the excel file to run? On the server side? Remote launching of apps at the client end is possible, but I doubt that you can do this directly (see below) from web server code. Also presumes they have Office installed on the remote machine. Remote execution needs to be enabled/allowed at the far end.

      "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

      1 Reply Last reply
      0
      • B bnath001

        Hello folks,

        I thought this would be very simple. but I am not able to.

        I tried simple code like this using href element. But it tries to open the sheet.xls in the browser window and says it can't find the file. I want the excel file to be opened in excel (not browser). Any suggestions?

        [some excel file](file://domainname/vol1/destinationfiles/sheet.xls)

        The excel file I am trying to open is not on IIS server. It is on file server.
        Thanks much

        nath
        .

        B Offline
        B Offline
        Bernhard Hiller
        wrote on last edited by
        #3

        Strange. I also thought it was easy. But on my system, every call to a href="file:..." fails when the page containing the link was obtained via http. Such links do work only when the page was opened with the file protocol. And the links do fail when the file to be opened is not on a local or mapped drive. Browsers offer to open the file (with Excel) when it is on a local/mapped drive or just download it. I tested with current versions of Internet Explorer, Firefox, Chrome, Opera, and Safari.

        R D 2 Replies Last reply
        0
        • B Bernhard Hiller

          Strange. I also thought it was easy. But on my system, every call to a href="file:..." fails when the page containing the link was obtained via http. Such links do work only when the page was opened with the file protocol. And the links do fail when the file to be opened is not on a local or mapped drive. Browsers offer to open the file (with Excel) when it is on a local/mapped drive or just download it. I tested with current versions of Internet Explorer, Firefox, Chrome, Opera, and Safari.

          R Offline
          R Offline
          R Hartley
          wrote on last edited by
          #4

          Well I've never tried it, (this is dusty_dex by the way - having account problems :~ ) The web server would most likely need to generate a local script with *application name hard coded*, then execute via a shell COM object. The local script can then do some remote checking of its own, and then launch the remote application. (Windows Script Host) That's how I would try to do it.

          1 Reply Last reply
          0
          • B Bernhard Hiller

            Strange. I also thought it was easy. But on my system, every call to a href="file:..." fails when the page containing the link was obtained via http. Such links do work only when the page was opened with the file protocol. And the links do fail when the file to be opened is not on a local or mapped drive. Browsers offer to open the file (with Excel) when it is on a local/mapped drive or just download it. I tested with current versions of Internet Explorer, Firefox, Chrome, Opera, and Safari.

            D Offline
            D Offline
            dusty_dex
            wrote on last edited by
            #5

            Well I've never had to try it, The web server would most likely need to generate a local script with *application name hard coded*, then execute via a shell COM object. The local script can then do some remote checking of its own, and then launch the remote application. (Windows Script Host) That's how I would try to do it.

            "It's true that hard work never killed anyone. But I figure, why take the chance." - Ronald Reagan That's what machines are for. Got a problem? Sleep on it.

            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