ActiveX/Office

자동화 - 파이썬

jjryu 2017. 9. 11. 22:04

import win32com.client

excel = win32com.client.Dispatch("Excel.Application")

excel.Visible = True

wb = excel.Workbooks.Add()

ws = wb.Worksheets("Sheet1")

ws.Cells(1, 1).Value = "..."

wb.SaveAs('...')

excel.Quit()


import win32com.client

excel = win32com.client.Dispatch("Excel.Application")

excel.Visible = True

wb = excel.Workbooks.Open('...')

ws = wb.ActiveSheet

... ws.Cells(1, 1).Value ...

excel.Quit()


참조 사이트:

https://wikidocs.net/2888

https://wikidocs.net/3644