I am trying to find the currently open excel file using win32com. Below is my code:
import win32com.client
excel = win32com.client.GetActiveObject('Excel.Application')
wb = excel.Workbooks(2)
I tried different numbers instead of 2 ( excel.Workbooks(2)). Does anybody have any idea why it not working? Thanks in advance