I would like to use Python to run a macro contained in MacroBook.xlsm on a worksheet in Data.csv.
Normally in excel, I have both files open and shift focus to the Da
1) you can't have VBA on a *.csv file. You need the *.xlsm file to be the active workbook. I don't think you need to open the *.csv file at all if your macro know how to find it.
2) Enable VBA module access in your Office Excel:
File
options
Trust Center
Trust Center Settings
Macro Settings
Enable VBA access
3)I am using this function to run macros:
excel.Application.Run("FilterLoans")
Try savin the macro to your "Normal" Project and call.
excel.Application.Run("Normal.ModuleName.SubName")
You can even add the Module to the Normal profile programmatically, but Office doesn't let you do it if you have insufficient access rights.