I am trying to copy a file to the following location:
\…+var1.ToString+“*”.…+“.xlsx”
value var1=9200
The … do not matter, its just a lot of path text.
The issue is I want to copy my file to following location: \…\9200XYZ.…xlsx
XYZ can be any value. That’s why in my code I am using “*” as wildcard. However it does not seem to work.
What can be the issue?
You can only use a wildcard when reading from a file that’s in a location that can vary. Right now the robot has no clue where to save the file, as you didn’t give it a specific value. Instead of the wildcard you can add in another variable to define the location, or use something static.
You have to read the Path of the file that you want to copy, and save it in a variable for be able to use it after, in the next steps of your process.
Also you can replace the text of the Path, I mean, if you have C:/…/XYZ.xlsx and you want to change the XYZ.xlsx for other excel file, replace the /XYZ.xlsx of the path for the new excel file or whatever you need.
PD: Moreover, as you said, the wildcard is correct, but like @evangemert said, “You can only use a wildcard when reading from a file that’s in a location that can vary. Right now the robot has no clue where to save the file, as you didn’t give it a specific value.”