cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
amamidwar23
Advocate I
Advocate I

Launch excel error when providing path from Input variable

HI,

 

Unable to launch excel when I am providing file path through INPUT variable Default value

 

path is correct , as when provided directly to launch excel action it is working perfect , only error when passing through input variable.

 

error - Failed to open Excel Document (File related error)

 

Please Help

@miketran13 launch excel err 1.PNGlaunch excel err 2.PNGlaunch excel err 3.PNG

 

Thanks 

 

AR

6 REPLIES 6
HarshChauhan
Frequent Visitor

did you find the solution?

Anonymous
Not applicable

Hi amamidwar23 & HarshChauhan

 

Please double check to see if the extension of path is correct or not.

As it should be “.xlsx” ".xlsm" etc. instead of "_xlsm"

 

Please see the reference.

on99username_1-1642041224062.png

 

Hope it helps.

Please mark it answered if you are satisfied.

 

Thanks.

 

hassan14a
Regular Visitor

I have the exact same issue.

File opens fine when i add the path directly, but file wont open when the variable with the filepath is used.

The same error goes for 'Run Application' action.

 

Is there any fix for this? If not, it seems like a big deal, not to be able to use variables with filepaths.

Thomas_Petersen
Advocate I
Advocate I

Depending on your OS config, you might need to escape the '\' . Try replacing each \ with \\.

hassan14a
Regular Visitor

That does not seem to be the issue.

Because it works fine when i add D:\test.xlsx  to 'Document path:' field.

 

I have done some further tests:
When i use the variable, that Power Automate created by using "Get files in folder", it does not work. Even though the correct filepath is shown.

 

My solution to this, is using a 'For Each' step to loop through the 'Files' variable that 'Get files in folder' step created.
Then adding a 'If' step to find the specific file I want  (using contains test.xlsx)

Then using 'Set variable' to set 'CurrentItem' variable (that was created by the 'If' action) to my own variable called 'filepath'.

Next using the launch excel step, to open the excel file with 'filepath' variable.

 

This is too much work. The 'Get files in folder' step, should be able to produce the a working variable that can be used directly in Launch excel or Run Application.

I have the same issue.

Looks like MS is not going to fix this.... maybe there is a work around.. 

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Top Solution Authors
Top Kudoed Authors
Users online (1,798)