0

TLDR: I want to receive the result(to python) from a vba function that I triggered via python. I am able to trigger the vba function.

I am able to trigger a vba function via python. Now, I want to receive the result of that vba function back in that same python program (the one that called the vba function). How do I do it?

Is it even possible?

Currently I am triggering my vba via this function:

xl = win32com.client.Dispatch("Excel.Application")
result = xl.Application.Run("my_vba_function_name", param1)

The reason why I want to trigger a vba function rather that modifying the excel file directly via python is that I want to be able to open and view/edit the file via microsoft excel at the same time.

Thanks

EDIT: I got the result from the other post.

3
  • 2
    Possible duplicate of How to call Excel VBA functions and subs using Python win32com? Commented Aug 16, 2017 at 8:26
  • @AlexanderMcFarlane I do not think this is a duplication. I am able to call VBA functions. I just want to find out is there a way to get some form of result from them. Commented Aug 16, 2017 at 8:27
  • @AlexanderMcFarlane Ah I see! Thanks! Commented Aug 16, 2017 at 8:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.