View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
[email protected] writetoevv@gmail.com is offline
external usenet poster
 
Posts: 7
Default How should i call below function

Hi Friends

Kindly let me know how can i use below function in excel.
can u provide function with sample data.


Private Declare Function URLDownloadToFile Lib ""urlmon"" Alias ""URLDownloadToFileA"" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Sub GetPageTitle()
Dim i As Long, url As String, lst As Long
lst = Sheet5.Range(""A"" & Rows.Count).End(xlUp).Row
For i = 2 To lst
DoEvents
url = ""http://www.nseindia.com/content/historical/EQUITIES/"" & Sheet5.Range(""B"" & i).Value & ""/"" & Sheet5.Range(""C"" & i).Value & ""/"" & Sheet5.Range(""D"" & i).Value
URLDownloadToFile 0, url, ""C:\Users\Dave3009\Documents\nseindia\"" & Sheet5.Range(""D"" & i).Value, 0, 0
Next
End Sub