Skip to main content
Solved

Word Package Issue

  • November 30, 2025
  • 3 replies
  • 53 views

Forum|alt.badge.img+1

I’m facing an issue while opening a .docx file using the Word package in Automation Anywhere.
When I assign the file path through a string variable or file-type variable, the document does not open.
However, if I provide the same path directly in the File Location field, the file opens without any issue.

Could you please help me understand why the path works when entered directly, but not when passed through a variable?. Then tell me how do I need to provide a dynamic path.

Thanks,
Dinesh

Best answer by Aaron.Gleason

@Dinesh C That’s very interesting. If the path OR the filename contain a space, it will not open the file when the full filename/path is in a String variable.

This appears to be an issue with the Word package only. Other packages don’t seem to have the same issue. 

I have an unusual workaround for you: 

  1. Set the full path (with spaces) into a string variable using a String: Assign.
  2. Use a String: Replace to replace the spaces with %20
  3. The Word package will open the file.

If you would, send an email to support@automationanywhere.com and start a bug report. You may reference this thread and my name in the email. 

3 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • December 2, 2025

@Dinesh C Not sure what you’re doing differently than me, but I have no problems.

The first action is the path hard-coded. This works, as it works for you.

The second action is me setting the same file path to the $sFilePath$ variable. 

The third action is me using the $sFilePath$ variable in the Desktop File option of Word: Open. This also works.

 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • December 14, 2025

I have attached a screenshot for reference.

I used the same file path in two ways:

  1. Stored the path in a string variable and passed it to the Open action - Not Working.

  2. Hardcoded the same path directly in the Open action field - Working.

The file path used as sample for reference:
C:\Users\Dinesh. C\Downloads\WordOpenTest.docx

I understand that the folder name "Dinesh. C" contains a space. However, when I provide this path directly in the Open action, it works without any issue. But when I pass the same path via a string variable, it does not work as expected.

Could you please help me understand:

  • Why the path works when hardcoded but fails when passed through a variable?

  • Is there any special handling required for paths with spaces when using string variables in Automation Anywhere?

Thank you in advance.


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • December 14, 2025

@Dinesh C That’s very interesting. If the path OR the filename contain a space, it will not open the file when the full filename/path is in a String variable.

This appears to be an issue with the Word package only. Other packages don’t seem to have the same issue. 

I have an unusual workaround for you: 

  1. Set the full path (with spaces) into a string variable using a String: Assign.
  2. Use a String: Replace to replace the spaces with %20
  3. The Word package will open the file.

If you would, send an email to support@automationanywhere.com and start a bug report. You may reference this thread and my name in the email.