まずはプログラマーではなく、Excelに入力データを入れてhttps://www.nseindia.com/products/content/equities/equities/eq_security.htmから見積もり履歴をダウンロードしたいだけです。私は何とかVBAにデータを置くことができました。誰でも "CSV形式のファイルをダウンロード" &をローカルディスクに保存する方法を教えてください。 UDF以下NSEインド見積もり履歴自動ダウンロード
Private Sub CommandButton1_Click()
Dim IE As Object
With IE
Set IE = CreateObject("InternetExplorer.Application")
'create new instance of IE. use reference to return current open IE if
'you want to use open IE window. Easiest way I know of is via title bar.
IE.Navigate "https://www.nseindia.com/products/content/equities/equities/eq_security.htm"
'go to web page listed inside quotes
IE.Visible = True
While IE.busy
DoEvents 'wait until IE is done loading page.
Wend
IE.document.ALL("symbol").Value = ThisWorkbook.Sheets("sheet1").Range("b1")
IE.document.ALL("series").Value = ThisWorkbook.Sheets("sheet1").Range("b2")
IE.document.getElementById("rdDateToDate").Click
IE.document.ALL("fromDate").Value = ThisWorkbook.Sheets("sheet1").Range("b4")
IE.document.ALL("toDate").Value = ThisWorkbook.Sheets("sheet1").Range("c4")
IE.document.getElementById("submitMe").Click
End With
End Sub
あるものは何でもへのセル参照は、あなたは 'Symbol'と' Series'に値を提供することができます?あなたの 'From Date'と' To Date'も理想的ですが、それらは重要ではありません – Zac
シンボル= SBIN、シリーズ= EQ、日付= 01-01-2012&To Date = 01-12-2012 –
そしてコードを入力してくださいIEを自動的に閉じます。ありがとうございました。 –