1

Hi I am trying to call a function of an xll addin through python. I have loaded the addin and everything runs fine, up to the point where I need to call a function where I an argument is optional and thus I can leave it blank, and then I get an error. Namely: in excel, function1 works fine if i type in a cell

=function1('a','b',,'d')

but if in python I write:

import os
import numpy as np
from win32com.client import Dispatch
Path  = 'myWeirdApp.xll'
xlApp = Dispatch("Excel.Application")
xlApp.RegisterXLL(Path)

the following line doesn't work:

xllApp.run('function1', 'a','b', , 'd')

does anybody have a solution for this type of situation?

2
  • Hi. I also have some xll add-in that I want to be able to load and use in python. Can you please share your solution? Thanks Commented Nov 8, 2019 at 14:02
  • xllApp is a typo, this should read xlApp.run('function1', ...) Commented Jan 26, 2022 at 14:09

1 Answer 1

2

Looks like that if you substitute the gaps with None it works fine!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.