How can I URL encode a string in Excel VBA?

后端 未结 15 2215
闹比i
闹比i 2020-11-22 11:39

Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality?

15条回答
  •  情深已故
    2020-11-22 12:13

    For the sake of bringing this up to date, since Excel 2013 there is now a built-in way of encoding URLs using the worksheet function ENCODEURL.

    To use it in your VBA code you just need to call

    EncodedUrl = WorksheetFunction.EncodeUrl(InputString)
    

    Documentation

提交回复
热议问题