📜  python 与 activeX 集成 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:16.285000             🧑  作者: Mango

代码示例1
import win32com.client

xlApp = win32com.client.Dispatch("Excel.Application")
xlApp.Visible=1

workBook = xlApp.Workbooks.Open(r"C:\MyTest.xls")
print str(workBook.ActiveSheet.Cells(i,1))
workBook.ActiveSheet.Cells(1, 1).Value = "hello"                
workBook.Close(SaveChanges=0) 
xlApp.Quit()