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

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

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

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?



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


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 (20.0 KB)

I can’t detect any white spaces


Write as below


This is working fine without any issue

Hope this will help you



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



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

thank you for all your time…!

1 Like


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


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