“错误”;HTTP 403该网站拒绝显示此网页;在Excel vba中导航URL时

“错误”;HTTP 403该网站拒绝显示此网页;在Excel vba中导航URL时,vba,excel,Vba,Excel,在ExcelVBA中,我尝试导航URL并从指定的URL获取表数据 首先,我硬编码了URL Set ie = CreateObject("InternetExplorer.Application") ie.navigate "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=VGUARD&instrument=OPTSTK&strike=1

在ExcelVBA中,我尝试导航URL并从指定的URL获取表数据

首先,我硬编码了URL

Set ie = CreateObject("InternetExplorer.Application")

ie.navigate "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=VGUARD&instrument=OPTSTK&strike=195.00&type=CE&expiry=29JUN2017"
这很好,我在excel中获得了表格数据

现在,我想从工作表中的两个单独的组合框(ComboBox1和ComboBox2)中获取底层的删除(请参见url)

因此,我将url更改为

ie.navigate "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/GetQuoteFO.jsp?underlying=" & ComboBox1.Value & "instrument=OPTSTK&strike=" & ComboBox2.Value & ".00" & "&type=CE&expiry=29JUN2017"
但它给了我一个机会 错误HTTP 403该网站拒绝显示此网页


如何修复它?

您缺少仪器前的附加安培数和:

ComboBox1.Value & "instrument=OPTSTK&strike="
应该是

ComboBox1.Value & "&instrument=OPTSTK&strike="

(仅供参考-您无法“修复”由您无法控制的服务器生成的HTTP错误)

您缺少仪器前的附加符号:

ComboBox1.Value & "instrument=OPTSTK&strike="
应该是

ComboBox1.Value & "&instrument=OPTSTK&strike="
(仅供参考-您无法“修复”由您无法控制的服务器生成的HTTP错误)