Read Range using variable as workbook path returning Illegal characters in path

Hi,
please assist

i have all my filenames (full path + extension) in a multi-line string

so i assign it into a string individually for my process
strFileNameReadRange = strFileNames1.Split(cchar(System.Environment.NewLine))(intFileCounter)
strFileNames1 = multi-line string
intFileCounter = line of multi-line string

it can return me properly when i use a message box and write line
but when i put into workbook path of read range activity
below message occurs
image

the variable i put into the workbook path = strFileNameReadRange
can advice what is wrong?

info
i can’t do a for each activity using the multi-line string or datatable, as the process is quite long. so i use a decision at the end of the process to loop it back and increase the intFileCounter

Hi @wilfred

Kindly check ehther your read range variable or extension variables contains any whitespaces

Hi @wilfred,

Can you share with us a sample path for reference, so it would be easy to identify the error?

Regards,
@90s_Developer

@wilfred

Can you share the correct input string you are making a split?

Also you can use writeline to see what the output you are getting from the split

Multilines are not allowed in the path of the file

Hope this may help you

Thanks

Hi,
pls see attached for my RPA
this is simplified, so pls ignore the start when i assign strFileNames

the trouble is at the read range
ReadRangeUsingVariable.zip (20.0 KB)

I can’t detect any white spaces

@wilfred

Write as below

image

This is working fine without any issue

Hope this will help you

Thanks

@wilfred

Check below, there was a whitespace which is stopping you with the error

So adding Trim option then you can remove all the whitespaces

Hope this will help you

Thanks

Hi,

thanks
i tried it and seems like it is working
i will do more testing

thank you for all your time…!

1 Like

@wilfred

Once you done with your testing Mark as solution that which post solves your issue

So this will help others if they face similar issue

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.