Skip to Content
エクセルのためのPython (Japanese Edition), 2nd Edition
book

エクセルのためのPython (Japanese Edition), 2nd Edition

by Felix Zumstein
May 2026
Intermediate
418 pages
6h 42m
Japanese
O'Reilly Media, Inc.
Content preview from エクセルのためのPython (Japanese Edition), 2nd Edition

第12章 xlwings Lite を使ったスクリプト

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

第4部で作成したようなのxlwingsツールを配布するのは大きな課題だ。なぜなら、各エンドユーザのマシンにPythonと必要なパッケージがインストールされている必要があるからだ。xlwings Liteは、ローカルへのインストールに依存関係がある代わりに、最新のExcelアドイン内でPythonを実行することで、この課題を解決した。ユーザはExcelのアドインストアからxlwings Liteをインストールするだけで、準備は完了だ。

xlwings Liteの設計目標は、開発者にとってもエンドユーザにとっても、VBAの操作感に可能な限り近づけることだ。VBAと同様に、xlwings LiteはPythonコードをワークブック内に直接保存するため、エンドユーザにとって必要な要件はxlwings Liteアドインのインストールだけとなる。 開発者の皆さんにとっても、使い勝手が馴染み深いはずだ。コードエディターはVBAエディタと類似性があり、F5キーを使ってコードを実行することもできる。

でxlwings Liteを実行するには、少なくともOffice 2021(永久ライセンス)またはMicrosoft 365サブスクリプションに付属するExcelのインストールが必要だ。ただし、旧バージョンのExcelを使用している場合でも、Web版Excelを使えば、この章の例題をこなすことは可能だ。 さらに良いことに、無料版の Excelでも動作する。無料のMicrosoftアカウントに登録するだけで、xlwings Liteをインストールできる。

この章では、xlwings Liteのインストール手順を解説する前に、その仕組みについて説明する。アドインの概要を簡単に紹介した後、NYCのタクシーデータセットを分析する。その過程で、DuckDB、Parquetファイル、PythonのAsyncioライブラリなど、いくつかの興味深い最新技術に触れることになる。最後に、xlwings Lite特有の機能や制限事項について確認し、この章を締めくくる。

xlwings Lite のはじめに

このセクションでは、xlwings Liteの仕組みについて簡単に概要を説明した後、アドインのインストール手順を解説する。その後、xlwings Liteのユーザインタフェースから、およびシート上のボタンから、xlwings Liteで最初のスクリプトを実行する。

xlwings Liteの仕組み

xlwings Lite( )は、WasmベースのPythonディストリビューションであるPyodideによって駆動される、最新のOffice.jsアドインだ。かなり長い説明になったので、これが具体的に何を意味するのか見ていこう!

長年にわたり、MicrosoftはExcelアドインを構築するための様々な技術を導入してきた。VBA(Visual Basic for Applications)、VSTO(Visual Studio Tools for Office)、COM(Component Object Model)、そしてXLL(Excel専用のダイナミックリンクライブラリ)アドインなどがある。 技術は異なるものの、これらには共通点が一つある。いずれもWeb版やモバイル版のExcelには対応していないため、 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大規模言語モデル:難しい部分 (Japanese Edition)

大規模言語モデル:難しい部分 (Japanese Edition)

Thársis T. P. Souza, Jonathan K. Regenstein

Publisher Resources

ISBN: 0642572395971