Guest User

Untitled

a guest
Jan 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import win32com.client
  2. xl = win32com.client.Dispatch("Excel.Application")
  3. xl.Visible = True
  4. wb = xl.Workbooks.Add()
  5. ws = wb.Worksheets.Add()
  6. cell = ws.Cells(1)
  7. cell.Value = 'text'
  8. wb.Close(True, r'c:AcousticAutomationTestFolderTestDatatest.xls')
  9.  
  10. os.rename('c:..file path...test.txt', 'c:..file path..test.csv')
  11.  
  12. import win32com.client
  13. xl = win32com.client.Dispatch("Excel.Application")
  14. xl.Visible = True
  15. wb = xl.WorkBooks.open(r'c:..test file path..test.xls’)
  16. xl.Run(‘DeleteTopRows')
Add Comment
Please, Sign In to add comment