AryanSingh
(Aryan Singh)
August 12, 2019, 7:18am
1
Hello guys
I am trying to retrieve the name from the an excel file then using this name from the excel file to name a “.docx” file.
But it is showing “file name format wrong”.
I am using the Directory.GetFiles(“folderPath”)
then using For each activity to get the file name then using this file name in the copy file activity to get the final name.
Please guide me.
Thanks in advance.
1 Like
HareeshMR
(Hareesh Madasi)
August 12, 2019, 7:21am
2
Can you post the error screenshot and the workflow how you are trying to do that @AryanSingh ?
Hi
@AryanSingh
How are you retrieving the File Name ?
can you use the below expression to fetch the filename and use it in an assign activity with an extension changed.
Assign:
string DocFilename= Path.GetFilenamewithoutExtension(ExcelFileName)
assign DocFilename =StoragePath+“"+DocFileName+”.docx"
storagePath is the folder path where the doc file has to be stored.
Regards
Vishnuvarthan P
AryanSingh
(Aryan Singh)
August 12, 2019, 7:27am
4
@HareeshMR
@vishnuvarthanp
Please check the image:
HareeshMR
(Hareesh Madasi)
August 12, 2019, 7:28am
5
You are trying to open a word document using excel application scope @AryanSingh
Hi
Please use the below expression : U r retrieving the fileName along with extension which is causing the issue
1 Like
HareeshMR
(Hareesh Madasi)
August 12, 2019, 7:32am
9
Yeah, I mean, reading the docx file using excel application gives the error. Excel Application scope is specially mentioned to open the excel files.
So, use word document activities or open application to open the word document @AryanSingh
1 Like
Hi
What @HareeshMR Said is correct.
Please also install Uipath.WordActivities from Manage packages to read doc file.
regards
Vishnu
AryanSingh
(Aryan Singh)
August 12, 2019, 7:41am
11
@HareeshMR
what i am trying to do is. For each excel file in the a folder i am trying to get the name of the those excel files.
since i am copying the doc file then making the changes and using the name retrieved for the current excel in for each activity then showing this error
AryanSingh
(Aryan Singh)
August 12, 2019, 8:02am
14
@vishnuvarthanp
@HareeshMR
Thanx brothers. Issue solved.
1 Like
AryanSingh
(Aryan Singh)
August 12, 2019, 8:07am
15
@vishnuvarthanp
@HareeshMR
Can u guys tell me in if activity , when i want to use Not equals to sign. It should be <> (This sign), right?
or any other symbol?
1 Like
system
(system)
Closed
August 15, 2019, 8:08am
18
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.