xlwings_use.py

import xlwings as xw

app=xw.App(visible=True,add_book=False)
app.display_alerts=False
app.screen_updating=False

wb = app.books.add()
#wb = xw.Book()
#wb = xw.books.add()

wb = app.books.open('data.xlsx')

sheet = xw.books['data.xlsx'].sheets['Sheet1']

book_name = sheet.book
print(sheet.name)

app.quit()

posted @ 2024-01-09 10:55  涵旭  阅读(3)  评论(0编辑  收藏  举报