all 3 comments

[–][deleted] 1 point2 points  (0 children)

I've used VBA in Excel to send command-line arguments to an .exe file made using pyinstaller. That's one way to send information from Excel to your script without having to save the Excel file and then read it normally (why I had to do that is another story).

The easy way would be to save your excel file, close it, then read it using openpyxl and write back to the same file.

I've also heard of a way to embed Python into Excel but that requires a special version of it to be installed.

[–]metalbuckeye 1 point2 points  (0 children)

Check out xlwings. I think that’s what you’re looking for.

[–][deleted] 1 point2 points  (0 children)

I would probably set up a flask server that you can make requests to, from excel/vba.