I'm trying to run this macro on Microsoft Excel, but every time I do, I get a
Run-time error '5'
What am I doing wrong? This is my first time doing something like this.
What's suppose to happen is that everytime I run the Keyboard Shortcut, it's suppose to get the data from the blockchain website.
It's essentially just code that says..
1 USD is worth this many 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