M Kaye
M Kaye

Reputation: 183

Get Active Workbook Using xlwings

I am trying to gain access to the active Excel workbook I have open using xlwings. Now I can do this using file paths but is there any way to do this without using the file path?

For example I am currently using:

xlwings.Workbook(file_path)

But if I take out file_path it creates a new workbook.

Thanks in advance,

Max

Upvotes: 1

Views: 3343

Answers (1)

Felix Zumstein
Felix Zumstein

Reputation: 7070

According to your syntax, you're using a pre-historic version of xlwings, I recommend you to upgrade to the latest version (Book instead of Workbook). Check out the docs for what you're looking for:

xlwings.books.active

Upvotes: 2

Related Questions