ORPA-pyOpenRPA/Sources/pyOpenRPA/Tools/RobotDB/ExcelCom.py

11 lines
333 B

import win32com.client as win32
def OpenWorkbook(xlapp, xlfile):
try:
xlwb = xlapp.Workbooks(xlfile)
except Exception as e:
try:
xlwb = xlapp.Workbooks.Open(xlfile)
except Exception as e:
print(e)
xlwb = None
return(xlwb)