Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 122221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:05:40+00:00 2026-05-11T04:05:40+00:00

We have various spreadsheets that employ deliciously complicated macros and third party extensions to

  • 0

We have various spreadsheets that employ deliciously complicated macros and third party extensions to produce complicated models. I’m working on a project that involves slightly tweaking various inputs and seeing the results. Rather than doing this by hand or writing VBA, I’d like to see if I can write a python script to drive this. In other words, the python script will start up, load the excel sheet, and then interact with the sheet by making minor changes in some cells and seeing how they affect other cells.

So, my question is twofold:

  • What is the best library to use to drive excel from python in such fashion?

  • Where’s the best documentation/examples on using said library?

Cheers, /YGA

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T04:05:40+00:00Added an answer on May 11, 2026 at 4:05 am

    For controlling Excel, use pywin32, like @igowen suggests.

    Note that it is possible to use static dispatch. Use makepy.py from the pywin32 project to create a python module with the python wrappers. Using the generated wrappers simplifies development, since for instance ipython gives you tab completion and help during development.

    Static dispatch example:

     x:> makepy.py 'Microsoft Excel 11.0 Object Library' ... Generating... Importing module x:> ipython 
    > from win32com.client import Dispatch > excel = Dispatch('Excel.Application') > wb = excel.Workbooks.Append() > range = wb.Sheets[0].Range('A1') > range.[Press Tab] range.Activate                 range.Merge range.AddComment               range.NavigateArrow range.AdvancedFilter           range.NoteText ... range.GetOffset                range.__repr__ range.GetResize                range.__setattr__ range.GetValue                 range.__str__ range.Get_Default              range.__unicode__ range.GoalSeek                 range._get_good_object_ range.Group                    range._get_good_single_object_ range.Insert                   range._oleobj_ range.InsertIndent             range._prop_map_get_ range.Item                     range._prop_map_put_ range.Justify                  range.coclass_clsid range.ListNames                range.__class__ > range.Value = 32 ... 

    Documentation links:

    • The O’Reilly book Python Programming on Win32 has an Integrating with Excel chapter.
    • Same book, free sample chapter Advanced Python and COM covers makepy in detail.
    • Tutorials
    • win32com documentation, I suggest you read this first.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an app that parses various forms of spreadsheets. It worked
I have a web project wherein I have various functions that either add values
We have various php projects developed on windows (xampp) that need to be deployed
We have various servers that have many directories shared. It's easy enough to look
I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL.
We have various related session variables for a complex page that has various things
I have various models of which I would like to keep track and collect
I have various Git projects that are on my local machine. I have a
I have various database fields that are decrypted using the to_python method. The problem
I have various web pages that need to build up a URL to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.