You can operate Excel with python while Excel is open You can draw a graph, and you can call python from vba.
I installed xlwings on virtualenv, but I get an error about win32api I used python27 because it came out.
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'
Recommended Posts