jiejie
(Call Me JJ)
April 9, 2019, 1:49am
1
here i got some problem with rename. This is the error shown when i try to rename.
![02|690x200]
This is my parameter.
(upload://lV914mxuNKgSVCeuzEx6v6ocGnJ.jpeg)
Is there anyone knw what is the mistake?
i already try to rename with another method also
This method can work when it separate from my workflow.But when i try to combine into my workflow, it cant work. Pls help me to solve this matter. Thanks
Hi @jiejie
I would humbly request you to choose a proper category for your post/topic when you create one.
In your case it would be mostly RPA dev rookies based on the pattern I have seen so for.
It would help us keep the forum topics well organized.
Thanks,
Prankur
2 Likes
srogo
(Beniamin)
April 9, 2019, 7:54am
3
Hi @jiejie ,
Instead of Invoke Method you can use “Move File” activity and move this file to the same directory but with different name.
jiejie
(Call Me JJ)
April 10, 2019, 3:33am
4
@srogo you mean form path use same name but to destination change the name?
jiejie
(Call Me JJ)
April 10, 2019, 3:34am
5
@PrankurJoshi noted and thanks.
jiejie
(Call Me JJ)
April 10, 2019, 5:48am
6
i get this error when i use move file.
my destination path is as this : “c:\Timesheet\TimesheetReport1” + valstart.ToString + valEnd.ToString +".xlsm "
what is the error?
1 Like
samir
(Samir Mohite)
April 10, 2019, 6:48am
7
@jiejie
I think you’re missing one Backslash
here,
after TimesheetReport1 ,
it should like this "c:\Timesheet\TimesheetReport1\”
jiejie
(Call Me JJ)
April 10, 2019, 8:35am
8
@samir even i put my destination file name like this : “c:\Timesheet"+valstart.ToString+valend.ToString+”.xlsm"
it show me error agian
sreekanth
(sreekanth)
April 10, 2019, 8:54am
9
You dont have that path,It should be “c:\Timesheet"+ valstart.tostring+valend.tosting+”.xlsm"
@jiejie
samir
(Samir Mohite)
April 10, 2019, 8:56am
10
@jiejie
your destination path should ends with \
you’re missing that slash,
instead of this —>“C:\Timesheet”
put one slash(\) at the end of your path —>“C:\Timesheet\”
jiejie
(Call Me JJ)
April 10, 2019, 8:57am
11
@sreekanth i already put as what u said
jiejie
(Call Me JJ)
April 10, 2019, 9:13am
13
@samir even i put the slash, still error
kaderms
(Kader)
April 11, 2019, 12:58pm
14
Can you try printing the two variables before this Move File activity, using message box or write line activity? Or run the workflow in debug mode to know the values of the variables at this instance.
Also note that while naming files, certain special characters are not allowed, like comma, slash, etc. Make sure your variables don’t contain any of these.
kaderms
(Kader)
April 11, 2019, 1:04pm
15
Continuing from
@kaderms my new file name will always have different file name which follow the variable .
[01]
and i get this error when i run.
My destination path is this one : “c:\Timesheet\TimesheetReport1” + valstart.ToString + valEnd.ToString + ".xlsm " valstart and valend is the date will change everytime.
I believe you the two variables that you are trying to use are dates. Can you show me the format of the dates? If it has / it could be a problem.
jiejie
(Call Me JJ)
April 13, 2019, 8:37am
16
@kaderms sorry for late reply. Before move file, i use message box and put variable inside and the result show like this.
Which this two variable are start date and end date.My variable dont have those.
and still show me the error:
jiejie
(Call Me JJ)
April 13, 2019, 8:45am
17
@kaderms i get the date from csv file, and here is my workflow and format.
assign:
valStart = row(“Start Date”).ToString.Split(" “c)(0).ToString
valEnd = row(“End Date”).ToString.Split(” "c)(0).ToString
type into
valstart.ToString + " " + “00:00”
valEnd.ToString+ " " + “23:59”
*startdate and enddate i get from csv file.
Thanks.
kaderms
(Kader)
April 14, 2019, 6:37am
18
File naming conventions in Windows doesn’t allow the below characters as a part of the file name.
So you will have to remove any of these special characters in your file name variables.
Also, can you share what is the actual file name of the source file that you are trying to move? Can you locate the file on disk and share the filename as it is saved on the disk?
1 Like
jiejie
(Call Me JJ)
April 14, 2019, 6:59am
19
@kaderms i dint use those symbols…
It relate to what file i try to move/Rename? I havnt try in disk, i juz try in c file.
jiejie
(Call Me JJ)
April 14, 2019, 7:17am
20
@kaderms i already solve this problem. i should replace / to - like this “c:\Timesheet\”+ valstart.Replace(“/”,“-”).Trim + valend.Replace(“/”,“-”).Trim +“.xlsm”
Thank you for helping