I am working on a project for work that involves HTTP requests. After struggling through getting that to work, my next problem is trying to prevent the VBA function from recalculating when one of the argument cells is cleared. Below is my attempt at a solution thus far:
My attempt at bypassing this was the implementation of the IF statement after the variable types are all declared.
The problem I am having as stated, is that when one of the cells is cleared, it recalculates the function. Often times, I will need to clear 500 rows and apart from taking a long time, it is unnecessary HTTP GET requests to the server, which upon implementation, will no longer be on localhost.
Any help here is appreciated.
VBA Code:
Function HTTPGet(ISO As String, HE As Single, Node As String, Bid As Single, MW As Single)
Dim sCmd As String
Dim sResult As String
Dim lExitCode As Long
Dim Counter As Integer
Dim MyArray() As String
If IsEmpty(HE) = True Or IsEmpty(Node) = True Or IsEmpty(Bid) = True Or IsEmpty(MW) = True Then
Exit Function
End If
sCmd = "curl --get http://localhost:8000/" & ISO & "/" & HE & "/" & Node & "/" & Bid & "/" & MW
sResult = execShell(sCmd, lExitCode)
HTTPGet = sResult
End Function
My attempt at bypassing this was the implementation of the IF statement after the variable types are all declared.
The problem I am having as stated, is that when one of the cells is cleared, it recalculates the function. Often times, I will need to clear 500 rows and apart from taking a long time, it is unnecessary HTTP GET requests to the server, which upon implementation, will no longer be on localhost.
Any help here is appreciated.