Book Image

Mastering Python for Finance

Book Image

Mastering Python for Finance

Overview of this book

Table of Contents (17 chapters)
Mastering Python for Finance
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 10. Excel with Python

In finance, Microsoft Excel is used as a handy tool for bond traders and is useful in banking operations, as well as task automations using Visual Basic for Applications (VBA). Excel supports the use of Component Object Model (COM) to extend the functionality for custom tasks. This is achieved with the use of COM add-ins as an in-process COM server. With VBA, a wrapper can be created for the COM add-in function so that the COM component can be integrated as a worksheet cell formula function. COM allows the reuse of objects across different software and hardware environments to interface with each other, without the knowledge of its internal implementation. It allows an object to be created in several languages, such as C, C++, Visual Basic, Delphi, or Python.

In this chapter, we will learn how to build a COM server in Python. We will then create a COM client in Microsoft Excel and interface with the COM server to perform numerical pricing on the call and put...