# Invoke python method excel

**URL:** <https://forum.uipath.com/t/invoke-python-method-excel/450853>\
**Category:** Activities\
**Tags:** question, python, excel, activities\
**Created:** [June 23, 2022, 4:32pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853 "2022-06-23T16:32:52Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nr.arinaazizi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nr.arinaazizi/32/266494_2.png) [@nr.arinaazizi](https://forum.uipath.com/u/nr.arinaazizi)\
**Post date:** [June 23, 2022, 4:32pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/1 "2022-06-23T16:32:52Z")

</div>

I have a problem with invoke python method. Here’s an example.

def printhello(x):  
return "hello world " + str(x)

For the above function, I used 9 and “meow” as InputParameters and it able to return “hello world 9” and “hello world meow”.

import pandas as pd  
def printhello(x):  
df = pd.read\_excel(x)  
return df.columns

I modified the function to this and use “hello.xlsx”. However, I encountered error at Invoke Python Method where the error is pipe is broken. Is excel file isn’t allowed to be used as input? What is the way for me to input excel file correctly for it to be read by UiPath?

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [June 23, 2022, 4:35pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/2 "2022-06-23T16:35:46Z")

</div>

Hello @nr.arinaazizi

Did you tried to tried to execute any very simple code using invoke python activity?  
If not just try it and make sure the error is not happening due to the configuration.

[![](https://global.discourse-cdn.com/uipath/original/4X/8/f/2/8f2754f248ccc164ad10ae5632ddb6727b5aa89f.jpeg "How to Execute Python Scripts in UiPath?| UiPath Python Activities| Python Scope| Load Python Script") ](https://www.youtube.com/watch?v=ysyH37iF-8Q)

---

<div class="post-metadata">

**Author:** ![nr.arinaazizi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nr.arinaazizi/32/266494_2.png) [@nr.arinaazizi](https://forum.uipath.com/u/nr.arinaazizi)\
**Post date:** [June 23, 2022, 4:38pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/3 "2022-06-23T16:38:57Z")

</div>

yes i tried it with below and it works out fine

def printhello(x):  
return "hello world " + str(x)

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [June 23, 2022, 4:43pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/4 "2022-06-23T16:43:15Z")

</div>

can you just try the below. Just to check the import of pandas library is causing any issue here.

import pandas as pd  
def printhello(x):  
return "hello world " + str(x)

---

<div class="post-metadata">

**Author:** ![nr.arinaazizi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nr.arinaazizi/32/266494_2.png) [@nr.arinaazizi](https://forum.uipath.com/u/nr.arinaazizi)\
**Post date:** [June 23, 2022, 4:47pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/5 "2022-06-23T16:47:56Z")

</div>

import pandas and still works out fine so the problem isn’t due to pandas

---

<div class="post-metadata">

**Author:** ![Rahul\_Unnikrishnan](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rahul_unnikrishnan/32/464046_2.png) [@Rahul\_Unnikrishnan](https://forum.uipath.com/u/Rahul_Unnikrishnan)\
**Post date:** [June 23, 2022, 4:50pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/6 "2022-06-23T16:50:28Z")

</div>

Did you tried the same code in any IDE?

---

<div class="post-metadata">

**Author:** ![nr.arinaazizi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nr.arinaazizi/32/266494_2.png) [@nr.arinaazizi](https://forum.uipath.com/u/nr.arinaazizi)\
**Post date:** [June 23, 2022, 4:52pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/7 "2022-06-23T16:52:18Z")

</div>

yup and every IDE shows result

i also found out this person has the same problem as mine. followed among the suggestions but still error [Invoke Pythod Method Error](https://forum.uipath.com/t/invoke-pythod-method-error/393809)

---

<div class="post-metadata">

**Author:** ![manohar\_e](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/manohar_e/32/64508_2.png) [@manohar\_e](https://forum.uipath.com/u/manohar_e)\
**Post date:** [June 23, 2022, 7:09pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/8 "2022-06-23T19:09:07Z")

</div>

In studio installation folder, in Program Files\UiPath\Studio\uipath.config file update MaxMessageSizeInMegaBytes to larger number. This would help you. Give a try and let us know the outcome.

---

<div class="post-metadata">

**Author:** ![nr.arinaazizi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/nr.arinaazizi/32/266494_2.png) [@nr.arinaazizi](https://forum.uipath.com/u/nr.arinaazizi)\
**Post date:** [June 24, 2022, 2:09am UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/9 "2022-06-24T02:09:48Z")

</div>

change from 10 to 100 and 200 and the pipe still broken. changed to 300, 500 and 1000 but the error is “RemoteException wrapping System.Exception: Job stopped with an unexpected exit code: 0xFFFFFFFF”

---

<div class="post-metadata">

**Author:** ![manohar\_e](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/manohar_e/32/64508_2.png) [@manohar\_e](https://forum.uipath.com/u/manohar_e)\
**Post date:** [June 27, 2022, 3:12pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/10 "2022-06-27T15:12:14Z")

</div>

Yes, correct!! I too faced a similar issue when we have imports in the python code.

@loginerror Or Any Expert here – Do we have any solution when we are executing Python script with imports.

---

<div class="post-metadata">

**Author:** ![loginerror](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/loginerror/32/22614_2.png) [@loginerror](https://forum.uipath.com/u/loginerror)\
**Post date:** [August 24, 2022, 1:46pm UTC](https://forum.uipath.com/t/invoke-python-method-excel/450853/11 "2022-08-24T13:46:03Z")

</div>

Any chance you could provide a zip of a sample dummy project that reproduces this issue for you @manohar_e or @nr.arinaazizi?
