Hi everyone,
I am trying to download a file from the following site
Access Denied
. Manually I will be able to download the csv file by clicking on the text "Download in csv". I am trying to automate the downloading process in excel. I am unable to find out why it is failing. I have a code which is trying to get the url by id and download the file and save it at the requirted lcoation. but it always fail trying to get the url. Could someone guide me on this.
Dim fileStream As ADODB.Stream
Dim xmlHTTP As MSXML2.xmlHTTP
Dim strURL As String
Dim strFile As String
Dim ie As InternetExplorer
Dim ieDoc As HTMLDocument
strURL = "https://www.nseindia.com/live_market/dynaContent/live_watch/equities_stock_watch.htm"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate strURL
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
Set ieDoc = ie.document
strFile = ieDoc.getElementById("Download in csv") *** its failing here****
thanks,
law
I am trying to download a file from the following site
Access Denied
. Manually I will be able to download the csv file by clicking on the text "Download in csv". I am trying to automate the downloading process in excel. I am unable to find out why it is failing. I have a code which is trying to get the url by id and download the file and save it at the requirted lcoation. but it always fail trying to get the url. Could someone guide me on this.
Dim fileStream As ADODB.Stream
Dim xmlHTTP As MSXML2.xmlHTTP
Dim strURL As String
Dim strFile As String
Dim ie As InternetExplorer
Dim ieDoc As HTMLDocument
strURL = "https://www.nseindia.com/live_market/dynaContent/live_watch/equities_stock_watch.htm"
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate strURL
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
Set ieDoc = ie.document
strFile = ieDoc.getElementById("Download in csv") *** its failing here****
thanks,
law