Open a Workbook with XLWINGS without making it visible

后端 未结 3 1746
独厮守ぢ
独厮守ぢ 2021-02-01 19:01

I am starting to use XLWings (not that I like Excel, at all, but it is something I HAVE TO do). The thing is that I cannot find the way to make Python open a Workbook without sh

3条回答
  •  情深已故
    2021-02-01 19:13

    You can also try:

    import xlwings as xw
    
    app = xw.App(visible=False)
    book = xw.Book('PATH_TO_YOUR_XLSX_FILE')
    sheet = book.sheets('sheetname')
    df = sheet.range('A1:D10)
    book.close()
    app.quit()
    

提交回复
热议问题