2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

"Python(Xlwings)を使ってExcelを操作してみる"を読んで

Posted at

Excel VBAからPythonを起動したい私にとってこの二つの記事は
とても参考になったのだが、記事の通りにやっても下記のエラーがでてうまくいかず、少々時間を食ってしまった。

---------------------------
Error
---------------------------
Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "c:\python\VBA_Test.py", line 1, in <module>

    from xlwings import Workbook, Range

ImportError: cannot import name 'Workbook' from 'xlwings' (C:\Program Files\Python37\lib\site-packages\xlwings\__init__.py)



Press Ctrl+C to copy this message to the clipboard.
---------------------------
OK   
---------------------------

初めて書いた記事に見る人がいるとは思わんが
解決方法を備忘録として書いておく。

http://docs.xlwings.org/en/stable/migrate_to_0.9.html#cheat-sheet
sample.PNG

書き方が単純に変わっていたのである。
・WorkbookをBookに置換
これで私は解決した。

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?