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. Save Excel in C#

Save Excel in C#

Scheduled Pinned Locked Moved C#
csharpcomtutorialquestion
8 Posts 4 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
    Mugdha_Aditya
    wrote on last edited by
    #1

    I want to save below excel on c drive without opening it. sFileName = "http://www.cboe.com/publish/ScheduledTask/MktData/datahouse/vxocurrent.csv"; how to do that??

    A 1 Reply Last reply
    0
    • M Mugdha_Aditya

      I want to save below excel on c drive without opening it. sFileName = "http://www.cboe.com/publish/ScheduledTask/MktData/datahouse/vxocurrent.csv"; how to do that??

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      Check this[^] out on msdn.

      The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

      M M 2 Replies Last reply
      0
      • A Abhinav S

        Check this[^] out on msdn.

        The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

        M Offline
        M Offline
        Mugdha_Aditya
        wrote on last edited by
        #3

        no this is of no use this.SaveAs(@"C:\Book1.xml", Excel.XlFileFormat.xlXMLSpreadsheet, missing, missing, missing, missing, Excel.XlSaveAsAccessMode.xlNoChange, missing, missing, missing, missing, missing); where to give file name which i want to save :( @"C:\Book1.xml is where u want to save that excel so please help me out

        M 1 Reply Last reply
        0
        • M Mugdha_Aditya

          no this is of no use this.SaveAs(@"C:\Book1.xml", Excel.XlFileFormat.xlXMLSpreadsheet, missing, missing, missing, missing, Excel.XlSaveAsAccessMode.xlNoChange, missing, missing, missing, missing, missing); where to give file name which i want to save :( @"C:\Book1.xml is where u want to save that excel so please help me out

          M Offline
          M Offline
          Mugdha_Aditya
          wrote on last edited by
          #4

          Got the answer string myFileName = "sample.xls"; using (WebClient wc = new WebClient()) { wc.Proxy = null; sFilePath = AppDomain.CurrentDomain.BaseDirectory; sFilePath = sFilePath.ToLower().Replace("\\bin\\debug\\", ""); sFilePath += "\\UkExcel\\" + myFileName; wc.DownloadFile(sFileName, sFilePath); }

          M 1 Reply Last reply
          0
          • M Mugdha_Aditya

            Got the answer string myFileName = "sample.xls"; using (WebClient wc = new WebClient()) { wc.Proxy = null; sFilePath = AppDomain.CurrentDomain.BaseDirectory; sFilePath = sFilePath.ToLower().Replace("\\bin\\debug\\", ""); sFilePath += "\\UkExcel\\" + myFileName; wc.DownloadFile(sFileName, sFilePath); }

            M Offline
            M Offline
            musefan
            wrote on last edited by
            #5

            If that is your answer then I suggest you work on improving your questions. Your problem actually has nothing to do with Excel so you will want to leave that out of your subject line for a start. All you are actually looking to do is download a file from a website to a local storage directory. An example of a good question might be.. Subject: Downloading a file from a given URL Message: I am trying to download a file from a URL and save it locally on my hard drive. How can this be achieved? ...of course, you should have easily been able to Google this answer without having to post in CP, but hopefully this will help you to write better questions in the future

            return 5;

            S 1 Reply Last reply
            0
            • A Abhinav S

              Check this[^] out on msdn.

              The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick

              M Offline
              M Offline
              musefan
              wrote on last edited by
              #6

              Sorry... but that really is a bad answer. I know the OP question wasn't great but you seem to have just focused on the words Excel and Save and posted the first link you could find In fact, did you even get past reading the subject line?! I do hope you answer other questions with a bit more effort Mr. MVP

              return 5;

              1 Reply Last reply
              0
              • M musefan

                If that is your answer then I suggest you work on improving your questions. Your problem actually has nothing to do with Excel so you will want to leave that out of your subject line for a start. All you are actually looking to do is download a file from a website to a local storage directory. An example of a good question might be.. Subject: Downloading a file from a given URL Message: I am trying to download a file from a URL and save it locally on my hard drive. How can this be achieved? ...of course, you should have easily been able to Google this answer without having to post in CP, but hopefully this will help you to write better questions in the future

                return 5;

                S Offline
                S Offline
                snouto
                wrote on last edited by
                #7

                musefan, the guy may not know how to format his question , but the end result is obvious for us , so instead of commenting the way he exposes his question , if you have an answer to his well clarified question so help him or just keep silent !

                Human knowledge belongs to the world.

                M 1 Reply Last reply
                0
                • S snouto

                  musefan, the guy may not know how to format his question , but the end result is obvious for us , so instead of commenting the way he exposes his question , if you have an answer to his well clarified question so help him or just keep silent !

                  Human knowledge belongs to the world.

                  M Offline
                  M Offline
                  musefan
                  wrote on last edited by
                  #8

                  snouto wrote:

                  the guy may not know how to format his question , but the end result is obvious for us

                  So why was the only attempted answer nothing to do with what the OP was trying to do?

                  snouto wrote:

                  if you have an answer to his well clarified question so help him or just keep silent

                  As you may already know there is more than one message type which to me suggests not everything needs to be an answer - All I have done is suggested ways in which the OP can improve his questions in the future so that it makes it easier for people to give an answer that can help If you want somebody to cut back on messages that didn't need to be said then I suggest you look at the one I am responding to, and the one you are going to respond back to me

                  return 5;

                  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