我正在尝试在 Microsoft Excel 上运行此宏,但每次我这样做时,我都会得到一个
运行时错误“5”
我究竟做错了什么?这是我第一次做这样的事情。
假设发生的是,每次我运行键盘快捷键时,都假设从区块链网站获取数据。
它本质上只是代码说..
1 美元值这么多 BTC
Sub USD_to_BTC()
'
' USD_to_BTC Macro
' Get the price of 1 btc if purchased by 1 USD
'
' Keyboard Shortcut: Ctrl+Shift+B
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;https://blockchain.info/tobtc?currency=USD&value=1", Destination:=Range( _
"$D$8"))
.CommandType = 0
.Name = "tobtc?currency=USD&value=1_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlAllTables
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub