Automate Excel Plz

mastermind007

Well-Known Member
#2

manishchan

Well-Known Member
#3
This link may help you

http://newtonexcelbach.wordpress.com/2012/08/19/automatic-download-of-csv-files/

And why multiple threads in TJ for the same question brother. :)

I want to download n save daily volatality file in excel .

Link to download r

Eq http://www.nseindia.com/archives/nsccl/volt/CMVOLT_17022014.CSV

Future http://www.nseindia.com/archives/nsccl/volt/FOVOLT_17022014.csv

Currency http://www.nse-india.com/archives/cd/volt/X_VOLT_17022014.csv

We can not save it automatically .How to download n save it directly in excel .
 
#5
Sub SaveCSV()
Dim myFile As Workbook, mainFile As Workbook
Dim ws As Worksheet
Dim c As Range, i As Integer
Dim myFolder As String

' Download the files

Application.ScreenUpdating = True
i = 0
For Each c In [CSV_Data]
Application.ScreenUpdating = True
Set myFile = Workbooks.Open(c.Value)

i = i + 1

If i = 1 Then
Set mainFile = myFile
Else
Application.ScreenUpdating = False
myFile.Worksheets(1).Copy after:=mainFile.Worksheets(mainFile.Worksheets.Count)
' Close CSV save
myFile.Close False
End If
Next c

' Where to save the files?
Application.DisplayAlerts = False
myFolder = ThisWorkbook.Worksheets("Sheet1").Range("fPathCell").Value
If Right(myFolder, 1) <> "\" Then myFolder = myFolder & "\"
With mainFile
.SaveAs myFolder & .Name, xlCSV
.Close
End With

Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "All done. CSVs saved: " & i
End Sub
*****************************************************
All files r being downloaded but not getting saved in 1 workbook .After download i want to save then each seperat worksheet .Can anybody please correct and post code Here please .
 

manishchan

Well-Known Member
#8
Thanks buddy..but im looking for the url which downloads the file directly like how the first post in this thread does. This is so that I can automate it excel. Please share if you have it.
Hi Manish

For EOD data

For equities
http://nseindia.com/products/content/equities/equities/eq_security.htm

And click the link
Download file in csv format


For indices
http://nseindia.com/products/content/equities/indices/historical_index_data.htm

And click the link
Download file in csv format