So I’m having trouble trying to get a method from an API to run correctly. Documentation says that the method has the following:
updateMethod(Object, String, Int)
The object is the worksheet or workbook that holds the item to be updated. The String is the name of the item, and the Int is what type of update will take place.
The method has to actually be used with a Boolean, as it will return True if updated and False if not:
wasUpdated = api.updateMethod(Object, String, Int)
So my code example is:
Function TestUpdate()
Dim wasUpdated As Boolean
Dim Container As Object
Dim RangeName As String
Dim refreshType As Integer
Set Container = ThisWorkbook.Worksheets(1)
RangeName = "RangeTest"
refreshType = 0
wasUpdated = api.updateMethod(Container, RangeName, refreshType)
If wasUpdate = True Then
MsgBox "Updated"
Else
MsgBox "Failed"
End If
End Function
I keep getting a Runtime-Error 424 on the wasUpdate = ... saying “Object Required”. Am I not defining the Object correctly? Or is this a possible issue with the API itself and I need to contact the company?
Thanks
Credit goes to @TimWilliams
The problem was not declaring an API object, had nothing to do with the container object.
Thanks for the help guys.