1
3

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ライブラリマスター (50)xlwings

Posted at

#【ライブラリ説明】
 Excelを開いたままpythonでExcel操作ができる
 グラフも描けるし、vbaからpythonを呼び出すことも可能

#【準備】
 virtualenv上でxlwingsをインストールしましたが、win32apiに関するエラーが
 出たためpython27を使用しました。

#【プログラム】

xlwings.py
# -*- coding: utf-8 -*-

import xlwings as xw
wb = xw.Workbook()
xw.Range('A1').value = 'Foo 1'
xw.Range('A1').value
# u'Foo 1'

xw.Range('A1').value = [['Foo 1', 'Foo 2', 'Foo 3'], [10.0, 20.0, 30.0]]
xw.Range('A1').table.value
# [[u'Foo 1', u'Foo 2', u'Foo 3'], [10.0, 20.0, 30.0]]

xw.Sheet(1).name
# u'Sheet1'

#【参考サイト】
 ホームページ
 document

1
3
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?