Guest User

Untitled

a guest
Jul 20th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. import webbrowser
  2. webbrowser.open('C:/Users/300231823/Desktop/GUI/simplenew4.xls')
  3.  
  4. from win32com.client import Dispatch
  5.  
  6. xl = Dispatch("Excel.Application")
  7. xl.Visible = True # otherwise excel is hidden
  8.  
  9. # newest excel does not accept forward slash in path
  10. wb = xl.Workbooks.Open(r'C:Users300231823DesktopGUIsimplenew4.xls')
  11. wb.Close()
  12. xl.Quit()
  13.  
  14. >>> app = xw.App() # or something like xw.apps[0] for existing apps
  15. >>> app.books['Book1']
Add Comment
Please, Sign In to add comment