Python

利用dispatch讀取excel


參考資訊:
1. driving-excel-from-python-in-windows

程式碼

from win32com.client import Dispatch

xl = Dispatch("Excel.Application")
xl.Visible = True
wb = xl.Workbooks.Open(r'main.xls')
ws = wb.Sheets[1]
print ws.Cells(791, 8).text
wb.Close()
xl.Quit()


返回上一頁