Passing File names and Sheet names as a argumrnt in Invoke Vbscript

Using Activity : “Invoke Vbscript”

Passing 4 Arguments

  1. “D:\UIPath_Dev_Space\Automate_ExcelAsDataBase\BlankProcess<File Name>.xlsx” (Contains Space in File Name) Ex: Alex hodzer Executive.xlsx
    2.“D:\UIPath_Dev_Space\Automate_ExcelAsDataBase\BlankProcess<File Name>.xlsx” (Contains Space in File Name) Ex: Alex hodzer Executive Report.xlsx
  2. “Sheet1”
  3. “Sheet1”

File is breaking and Not even getting all the Arguments inside the script.
ot able to upload this Image
Error liks:
This is My FIle NAme: “D:\UIPath_Dev_Space\Automate_ExcelAsDataBase\BlankProcess****.xlsx”
After Executing this script the File name will be geeting Like

“D:\UIPath_Dev_Space\Automate_ExcelAsDataBase\BlankProcess*File , Name*.xlsx”
it’s breaking the file name. Also not getting all the parameters in side the Vbscript.

Here is my Code:

Option Explicit
On Error Resume Next

Dim ExcelObject,Input1,Input2,Intput1_Sheet,Intput2_Sheet

Input1 = Wscript.Arguments.item(0)
Input2 = Wscript.Arguments.item(1)
Intput1_Sheet = Wscript.Arguments.item(2)
Intput2_Sheet = Wscript.Arguments.item(3)
MsgBox Input1 & " , " & Input2 & " , " & Intput1_Sheet & " , " & Intput2_Sheet

can Somebody Please help me how to fix this issue.

when passing in the arguments, replace the spaces with a placeholder e.g.

then in vbscript, replace with " " to get the original result