Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, nothing built-in (until Excel 2013 – see this answer).
There are three versions of
URLEncode()in this answer.A variant that supports UTF-8 encoding and is based on
ADODB.Stream(include a reference to a recent version of the ‘Microsoft ActiveX Data Objects’ library in your project):This function was found on freevbcode.com:
I’ve corrected a little bug that was in there.
I would use more efficient (~2× as fast) version of the above:
Note that neither of these two functions support UTF-8 encoding.