psychopy.org | Reference | Downloads | Github

Running an Excel Macro with Python

It seems that the following code would run a macro

import win32com.client
xl=win32com.client.Dispatch('Excel.Application')
xl.Workbooks.Open(Filename=r'C:\Path\File.xlsm', ReadOnly=1)
xl.Application.Run('Macro_Name')
xl.Application.Quit()
del xl

But win32com.client cannot be used with Mac (if I am not mistaken),
Any idea to overcome this problem?

Maybe this:

But I think you’ve already been looking into using that library?

Thanks for your response. Yes, I already explored the suggestions from this link and they didn’t work…