Open dynamic MS Word file

I have a word template which I edit.

Therefore I the following steps:

  1. Extract data from Excel file and write into variables
  2. Create new file with dynamic name from extracted variables, e.g. name + currentdate + “docx”
  3. Open this newly created file and replace placeholder text with extracted variables

Step 3 doesn’t work for me, because I always get the error, that the given paths format is not supported.

Here’s what it looks like:
“D:\my robot\results” + Today + “-whatever-” + name + “.docx”
(note: bolded text are previously extracted variables)

Thank you!

Phil

1 Like

Hello Phill and welcome to the community.
What is the exception that you are getting?
Try using Today.ToString maybe that will help.

I would try to log this whole part “D:\my robot\results” + Today + “-whatever-” + name + “.docx”

And after that i would try to access it manually. If you cannot access it robot also can’t

2 Likes

Thanks @srdjan.suc that helped.

Discovered the main error was that I have not declared the variables globally but only for the Sequence they were created in.

1 Like

Oh so the scope was the problem. Glad you resoled your issue

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