I have been attempting to create a graph from a API. I have set up the connection to the API in an excel worksheet and it displays the moving price of BTCUSD from an exchange. The value changes at a set interval as by the connection properties in the data tab in excel. I have tried a number of times with various approaches.
- Worksheet_Change(ByVal Target As Range) this does not work as Worksheet_Change does not trigger when the value changes in the API data cell don't understand why.
An ActiveX textbox linked to the data cell, this triggers textbox_change() event however I have run into another problem with the error 1004 Unable to get the CurrentRegion property of the range class. Your assistance would be appreciated. This is the code.
Public Sub TextBox1_Change() With ThisWorkbook.Names("DDEList").RefersToRange.CurrentRegion With .Offset(.Rows.Count, 0).Resize(1, 1) .Value = Now .Offset(0, 1).Value = TextBox1.Value End With End With End Sub
In the workbook sheet is a named cell called DDEList and the ActiveX textbox and cell A1 has a reference to the table data created by the API. I know how to create a graph from the data in cells the creation of the cell data is the issue.