【发布时间】:2018-06-16 14:04:18
【问题描述】:
我是 excel vba 的新手。我在网站 URL 中有数据。我需要导入工作簿表。我可以创建工作表并导入,而我想导入特定的工作表。
这个作品
Sub Test()
Application.DisplayAlerts = False
strURL = "https://www.nseindia.com/products/dynaContent/equities/equities/histscrip.jsp?symbolCode=1693&symbol=AXISBANK&symbol=axisbank&segmentLink=17&symbolCount=1&series=ALL&dateRange=1month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE"
Application.Workbooks.Open (strURL)
Application.DisplayAlerts = True
End Sub
但以下修改代码不起作用。任何帮助将不胜感激。
Sub OpenCSV()
Application.DisplayAlerts = False
strURL = "https://www.nseindia.com/products/dynaContent/equities/equities/histscrip.jsp?symbolCode=1693&symbol=AXISBANK&symbol=axisbank&segmentLink=17&symbolCount=1&series=ALL&dateRange=1month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE"
Worksheets("dump").Range("A1").Select
With Selection
.Open (strURL)
End With
Application.DisplayAlerts = True
End Sub
【问题讨论】: