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.

Bosen
  • 941
  • 2
  • 12
  • 26
  • 2
    Possible duplicate of [How to call Excel VBA functions and subs using Python win32com?](https://stackoverflow.com/questions/14732340/how-to-call-excel-vba-functions-and-subs-using-python-win32com) – Alexander McFarlane Aug 16 '17 at 08: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. – Bosen Aug 16 '17 at 08:27
  • @AlexanderMcFarlane Ah I see! Thanks! – Bosen Aug 16 '17 at 08:32

0 Answers0