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. General Programming
  3. C#
  4. only open excel file

only open excel file

Scheduled Pinned Locked Moved C#
help
4 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.
  • M Offline
    M Offline
    Mangesh Tomar
    wrote on last edited by
    #1

    hi, i want to open only excel file using OpenFileDialog box need help. here is my code which open any file from local drive. private void button1_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); openFileDialog1.ShowDialog(); System.Diagnostics.Process.Start(openFileDialog1.FileName, "Fileselected"); }

    S 1 Reply Last reply
    0
    • M Mangesh Tomar

      hi, i want to open only excel file using OpenFileDialog box need help. here is my code which open any file from local drive. private void button1_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); openFileDialog1.ShowDialog(); System.Diagnostics.Process.Start(openFileDialog1.FileName, "Fileselected"); }

      S Offline
      S Offline
      Sunil Lanke
      wrote on last edited by
      #2

      Apply filter to OpenFileDialog OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Excel|*.xls"; ofd.ShowDialog(); System.Diagnostics.Process.Start(ofd.FileName, "Fileselected");

      M 1 Reply Last reply
      0
      • S Sunil Lanke

        Apply filter to OpenFileDialog OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "Excel|*.xls"; ofd.ShowDialog(); System.Diagnostics.Process.Start(ofd.FileName, "Fileselected");

        M Offline
        M Offline
        Mangesh Tomar
        wrote on last edited by
        #3

        is there any method to get entiered file string in text box from OpenFileDialog box

        C 1 Reply Last reply
        0
        • M Mangesh Tomar

          is there any method to get entiered file string in text box from OpenFileDialog box

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          No, only the full path. You can use Path.GetFileName to get the filename without the path in front of it

          Christian Graus Driven to the arms of OSX by Vista.

          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