cancel
Showing results for 
Search instead for 
Did you mean: 

Correct Syntax for fields of "Save As" MS Word VBO action?

LennyAdams
Level 3

Hi There,

15663.jpg
I'm working with an MS Word VBO business object action labelled as "Save As". It has three fields that require input and I have been getting the same error for quite some time now. It is as follows:

"Internal : Could not execute code stage because exception thrown by code stage: Bad file name"

I have crafted a very simple implementation in order to streamline the process of saving the generated Word document.

Here are some screenshots:


15664.png

15665.png
15666.png
15667.png
Would you happen to know the proper syntax--or better yet, where to find a compilation that contains examples of the proper syntax?

Thank You! 
🙂


------------------------------
Lenny Adams
Technology Early Career Development Program (TECDP) Intern
Cigna
------------------------------
1 BEST ANSWER

Helpful Answers

Hi Mohammad,

Thank you so much for your insight! I utilized it and was able to successfully use the MS Word VBO "Save As" action. 

I will post a summary of the solution steps here just in case anyone needs them in the future. :c)

=========================================================================================

The solution looks like this:

 

15661.png


It appears that my primary issue was that I had NOT created an MS Word instance first!!


Once I followed the following procedure, it FINALLY worked:


1) Create MS Word Instance and pass output to Handle data item.

2) Create MS Word document and pass output to DocumentName data item.

3) Type test text in MS Word document (passed Message data item to input parameter).

4) Use "Save As" MS Word VBO action the following arguments:

15662.png

5) Detach from created MS Word Instance.

 

And that did the trick!

Thanks for the feedback, Team. :c)



------------------------------
Lenny Adams
Technology Early Career Development Program (TECDP) Intern
Cigna
------------------------------

View answer in original post

4 REPLIES 4

AntonHosang1
Level 4
Hi, you entered the double quotes in the data item. They are not needed to make text in Data Items. Only use quotes to mark a string in the Expression editor/inputs.

------------------------------
Anton Hosang
RPA Developer
Smart Automation Services
Europe/London
------------------------------

Hi Anton,

Thank you for your response. I have adjusted the data item text field and yet the same error (Bad Filename) is still being thrown by BP. Here's a screenshot for reference:

15655.png
Any other ideas as to why this is still happening?

Thank You.


------------------------------
Lenny Adams
Technology Early Career Development Program (TECDP) Intern
Cigna
------------------------------

Hi Team, 

Please use create instance first then you will get the output.
Pass that output ie.handle for all actions like create document and save as . Hope you will not get the error and also use close instance before killing ms Word. 



------Original Message------

Hi, you entered the double quotes in the data item. They are not needed to make text in Data Items. Only use quotes to mark a string in the Expression editor/inputs.

------------------------------
Anton Hosang
RPA Developer
Smart Automation Services
Europe/London
------------------------------

Hi Mohammad,

Thank you so much for your insight! I utilized it and was able to successfully use the MS Word VBO "Save As" action. 

I will post a summary of the solution steps here just in case anyone needs them in the future. :c)

=========================================================================================

The solution looks like this:

 

15661.png


It appears that my primary issue was that I had NOT created an MS Word instance first!!


Once I followed the following procedure, it FINALLY worked:


1) Create MS Word Instance and pass output to Handle data item.

2) Create MS Word document and pass output to DocumentName data item.

3) Type test text in MS Word document (passed Message data item to input parameter).

4) Use "Save As" MS Word VBO action the following arguments:

15662.png

5) Detach from created MS Word Instance.

 

And that did the trick!

Thanks for the feedback, Team. :c)



------------------------------
Lenny Adams
Technology Early Career Development Program (TECDP) Intern
Cigna
------------------------------