Hi all,
My objective is to automate the download the current futures data from the website www.nseindia.com. For this, I tried using the following code:
Sub Test1()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.nseindia.com/products/content/derivatives/equities/historical_fo.htm"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
doc.GetElementById("instrumentType").Value = Range("A2")
doc.GetElementById("symbol").Value = Range("B2")
'doc.GetElementById("year").Value = Range("C2")
'doc.GetElementById("expiryDate").Value = Range("D2")
'doc.GetElementById("rdDateToDate").******* = "makeReadonly()"
'doc.GetElementById("fromDate").Value = Range("E2")
'doc.GetElementById("toDate").Value = Range("F2")
'doc.GetElementById("getButton").Click
End Sub
A2 = FUTIDX
B2 = NIFTY
C2 = 2000
D2 = 29-06-2000
E2 = 12-06-2000
F2 = 29-06-2000
After selecting the first drop, down nothing else works. My research led me to understand that this cannot be done using IE. Accordingly, I tried installing a Selenium wrapper and then tried with the following code:
Sub ChromeAutomation()
Chrome.Start: Chrome.Get "https://www.google.it/"
End Sub
However, excel throws up an error at .start.
The volume of data to be downloaded does not lend itself to manual work and thus I'd be grateful for any solutions to achieve the desired objective. Many thanks in advance.
My objective is to automate the download the current futures data from the website www.nseindia.com. For this, I tried using the following code:
Sub Test1()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.nseindia.com/products/content/derivatives/equities/historical_fo.htm"
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set doc = IE.document
doc.GetElementById("instrumentType").Value = Range("A2")
doc.GetElementById("symbol").Value = Range("B2")
'doc.GetElementById("year").Value = Range("C2")
'doc.GetElementById("expiryDate").Value = Range("D2")
'doc.GetElementById("rdDateToDate").******* = "makeReadonly()"
'doc.GetElementById("fromDate").Value = Range("E2")
'doc.GetElementById("toDate").Value = Range("F2")
'doc.GetElementById("getButton").Click
End Sub
A2 = FUTIDX
B2 = NIFTY
C2 = 2000
D2 = 29-06-2000
E2 = 12-06-2000
F2 = 29-06-2000
After selecting the first drop, down nothing else works. My research led me to understand that this cannot be done using IE. Accordingly, I tried installing a Selenium wrapper and then tried with the following code:
Sub ChromeAutomation()
Chrome.Start: Chrome.Get "https://www.google.it/"
End Sub
However, excel throws up an error at .start.
The volume of data to be downloaded does not lend itself to manual work and thus I'd be grateful for any solutions to achieve the desired objective. Many thanks in advance.