Save Excel in C#
-
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??
-
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??
-
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
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
-
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
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); }
-
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); }
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;
-
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
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;
-
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;
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.
-
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.
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;