import win32com.client import time xlApp = win32com.client.Dispatch("Excel.Application") xlApp.Visible=1 workBook = xlApp.Workbooks.Open(r"C:\Users\tekibrain\Desktop\datelist.xlsx") print(str(workBook.ActiveSheet.Cells(1,1))) now = time.time() workBook.ActiveSheet.Cells(1, 2).Value = now #SaveChanges = 1 : Save flle # SaveChanges = 0 : Nothing Saved workBook.Close(SaveChanges=1) xlApp.Quit()
沒有留言:
張貼留言