0

What is wrong with the following code to encode the consumer key and secret as base64:

Private Function EncodeBase64(ByVal input As String) As String
    
    Dim data() As Byte
    Dim result As String
    
    data = StrConv(input, vbFromUnicode)
    result = Application.EncodeBase64(data)
    
    EncodeBase64 = result
    
End Function
braX
  • 11,506
  • 5
  • 20
  • 33
  • What error do you get? – Solar Mike May 03 '23 at 10:38
  • Gives compile error, expected identifier and at the line data = StrConv(input, vbFromUnicode) – Pankaj Garg May 03 '23 at 10:39
  • 1
    It looks like `input` is not allowed as variable name - try renaming it to e.g. `strInput`. – Ike May 03 '23 at 10:43
  • It solved the identifier error. Thanks! It gave new error at line result = Application.EncodeBase64(data) object does not support this property or method – Pankaj Garg May 03 '23 at 10:45
  • 1
    Didn't recognize that: but there is not `EncodeBase64` method in VBA. But look e.g. here: https://stackoverflow.com/q/169907/16578424 – Ike May 03 '23 at 11:26

0 Answers0