در واقع مشکل از این توابع نیست؛ خروجی دستور هست که کاراکتر carriage return اضافی داره (کد اسکی 13)
توابع رو بصورت زیر اصلاح کنین:
Public Function ShellRun(sCmd As String) As String
CreateObject("WScript.Shell").Run "cmd /c " & sCmd & " | clip", 0, True
ShellRun = Replace(CreateObject("htmlfile").ParentWindow.Clip boardData.GetData("text"), vbCr, "")
End Function
Public Function ShellRun2(sCmd As String) As String
Dim oShell As Object
Set oShell = CreateObject("WScript.Shell")
Dim oExec As Object
Dim oOutput As Object
Set oExec = oShell.Exec(sCmd)
Set oOutput = oExec.StdOut
ShellRun2 = Replace(oOutput.readall, vbCr, "")
End Function