none
Run Curl Commands in Excel VBA RRS feed

  • Question


  • I'm trying to figure out a way to pass variables into cURL commands (maybe this will interact with Ubuntu, or the CMD window, or something else; not totally sure).

    I have some cURL commands like this:

    curl -X "GET" -H "Authorization: Bearer API_Key" "https://url-plat-api/drives/my"

    Now, I want to pass in my API_Key ID and run the cURL command. 


    Also, I have some cURL commands like this:

    curl -H "Authorization: Bearer API_Key" "https://url-plat-api/identities/email/me@gmail@corp.com"

    Here, I want to pass in the API_Key and the emailID, and run the cURL command.

    How can I run these cURL commands in Excel?  Eventually I will select items from a ComboBox, and pass these variables into a VBA command, and run that.  I can do these things very easily.  I just need help setting up the VBA script to interact with cURL.
    Thanks!!


    MY BOOK




    • Edited by ryguy72 Monday, September 24, 2018 3:42 PM
    Monday, September 24, 2018 3:39 PM

All replies

  • Hi ryguy72,

    Please check if the solution in the following link will help:

    Excel VBA - CURL - PUT - JSON - WinHttpRequest

    Also, you can write curl commands into .bat files to run cURL commands in Excel VBA :

    Running a .bat windows batch file from excel VBA

    Hopefully it helps you.

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, September 25, 2018 6:17 AM
    Moderator
  • Thanks.  I don't think Excel is the right tool, or even close to it, for this kind of work.

    MY BOOK

    Tuesday, September 25, 2018 1:41 PM
  • Hi ryguy72,

    So now, do you still would to use Excel to do your work as your title "Run Curl Commands in Excel VBA" said?

    Best Regards,

    Yuki


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, September 26, 2018 6:50 AM
    Moderator