Hello,
I'm trying to use the Escape function from VBScript to encode some URL addresses (not available in VBA). Looks like this:
Works fine unless strString is something like
strString = """hehe"
I've tried replacing single " with "", but it keeps generating syntax errors.
What can I do in this case?
I'm trying to use the Escape function from VBScript to encode some URL addresses (not available in VBA). Looks like this:
Code:
Function Escape(strString As String) As String
Dim objVBScript As Object
Dim str As String
Set objVBScript = CreateObject("MSScriptControl.ScriptControl")
objVBScript.Language = "VBScript"
objVBScript.Reset
Escape = objVBScript.Eval("escape(""" & strString & """)")
End Function
Works fine unless strString is something like
strString = """hehe"
I've tried replacing single " with "", but it keeps generating syntax errors.
What can I do in this case?