0

I am trying to make a button that calls a sub in VBA with parameters.

enter image description here

  • When I assign this macro to the button:

    KrakenBook.xlsm!Sheet4.CreateDoublePercentageOrder "LTCUSD", 10, 10, .04, .04
    

    I get this error:
    enter image description here

  • When I try to assign it like this (the same thing but with apostrophes around it):

    'KrakenBook.xlsm!Sheet4.CreateDoublePercentageOrder "LTCUSD", 10, 10, .04, .04'
    

    I get this error:
    enter image description here

No idea why. And no, I triple-checked and I do NOT have brackets in the directory of my xlsm file.

Here's the code of the sub I'm trying to call:

Public Sub CreateDoublePercentageOrder(assetPair As String, buyPercentage As Double, sellPercentage As Double, buyVolume As Double, sellVolume As Double)
    Dim result As String
    Dim success As Boolean
    Dim description As String
    Dim buyTxid As String
    Dim sellTxid As String
    
    result = krakenOrderingSystem.AddDoublePercentageOrder(assetPair, buyPercentage, sellPercentage, buyVolume, sellVolume, buyTxid, sellTxid, description, success)
    If (success) Then
        MsgBox buyTxid + "   " + sellTxid + vbCrLf + description + vbCrLf + result
    Else
        MsgBox result
    End If
End Sub
GSerg
  • 76,472
  • 17
  • 159
  • 346
grant martin
  • 107
  • 1
  • 7

0 Answers0