[{"data":1,"prerenderedAt":95},["ShallowReactive",2],{"topic:xlwings":3},[4,14,19,25,31,37,43,49,55,62,67,73,78,83,89],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":13},"\u002Fautomating-reporting-workflows\u002Ftesting-and-packaging-excel-automation-scripts\u002Ftest-win32com-and-xlwings-code-without-excel","Test win32com and xlwings Code Without Excel","Unit-test Python code that drives Excel through win32com or xlwings on machines without Excel — Linux CI runners, Macs, containers: keep the Excel calls in a thin layer, pass the application in, replace it with small fakes that record what was done, check that workbooks are closed and Excel quit even after errors, stub the win32com import for older code, and keep real-Excel tests for Windows only.","how-to",[10,11,12],"com-automation","xlwings","reliable-jobs",null,{"path":15,"title":16,"description":17,"type":8,"topics":18,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fautomate-excel-on-macos-with-python","Automate Excel on macOS with Python","pywin32 and COM do not exist on a Mac, so automating Excel there takes different tools: openpyxl and pandas when you only need the file, xlwings when Excel itself must do the work, AppleScript through osascript for the odd task xlwings does not cover — plus the macOS permission prompts, the Excel sandbox file-access dialog, and scheduling with launchd.",[10,11],{"path":20,"title":21,"description":22,"type":8,"topics":23,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fxlwings-vs-pywin32-for-excel-automation","xlwings vs pywin32 for Excel Automation","Both drive the same Excel through the same interface. Compare the code for one task, see what the wrapper adds, and learn when the raw object model is still the better choice.",[24,11,10],"choosing-libraries",{"path":26,"title":27,"description":28,"type":29,"topics":30,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics","Automating Excel With xlwings: The Basics","Drive a live Excel application from Python with xlwings: open workbooks, read and write ranges, write a list down a column, run VBA macros, and quit Excel cleanly.","guide",[11],{"path":32,"title":33,"description":34,"type":8,"topics":35,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fcall-python-from-excel-with-xlwings-udf","Call Python from Excel with an xlwings UDF","Expose a Python function as a worksheet formula with xlwings — the add-in setup, @xw.func and @xw.arg decorators, array and DataFrame arguments, and the Windows-only limits.",[36,11],"macros-and-vba",{"path":38,"title":39,"description":40,"type":8,"topics":41,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fcontrol-how-xlwings-converts-dataframes-and-ranges","Control How xlwings Converts DataFrames and Ranges","Get the Python values you expect from xlwings: why a range comes back as a scalar, a list or a list of lists, and how ndim, numbers, dates, empty, transpose and expand change that; how the DataFrame converter treats headers and the index on read and write; dictionaries from two-column ranges; and writing a custom converter for your own conventions, with its logic tested without Excel.",[11,42],"pandas",{"path":44,"title":45,"description":46,"type":8,"topics":47,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fformat-cells-in-a-live-workbook-with-xlwings","Format Cells in a Live Workbook with xlwings","Style a workbook that is open in Excel from Python: fill colours, fonts, number formats and column widths through xlwings' own properties, borders and conditional formats through the .api escape hatch, an Excel table with a built-in style, and the screen-updating and range-at-once habits that keep formatting thousands of cells fast — plus how this differs from formatting a file with openpyxl.",[11,48],"cell-styling",{"path":50,"title":51,"description":52,"type":8,"topics":53,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Finsert-a-matplotlib-plot-into-a-live-workbook-with-xlwings","Insert a matplotlib Plot into a Live Workbook with xlwings","Put a matplotlib chart into a workbook that is open in Excel and keep it up to date: read the data with xlwings, build the figure, add it with sheet.pictures.add, place it next to a cell with anchor, replace it in place on every run with name and update=True, choose PNG resolution or SVG, and size it so it looks right on screen and in print.",[11,54],"charts-and-images",{"path":56,"title":57,"description":58,"type":8,"topics":59,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fread-and-write-a-live-excel-workbook-with-xlwings","Read and Write a Live Excel Workbook with xlwings","Drive the open application rather than the file: connect to a running workbook, read and write ranges, force a recalculation, read what the formulas produced, and clean up so no invisible Excel is left behind.",[11,60,61],"reading-excel","writing-excel",{"path":63,"title":64,"description":65,"type":8,"topics":66,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Frun-python-from-an-excel-button-with-xlwings","Run Python from an Excel Button with xlwings RunPython","Let Excel users run your Python code with a button — xlwings quickstart, the RunPython VBA call, Book.caller() to reach the calling workbook, passing arguments, configuring the interpreter, testing with a mock caller, and distributing the workbook.",[11,36],{"path":68,"title":69,"description":70,"type":8,"topics":71,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fspeed-up-xlwings-with-bulk-reads-and-writes","Speed Up xlwings with Bulk Reads and Writes","Make xlwings scripts fast by moving whole ranges in single calls instead of looping over cells — expand and options for DataFrames, 2D lists, turning off screen updating, events and automatic calculation, and chunksize for very large ranges.",[11,72],"large-files",{"path":74,"title":75,"description":76,"type":8,"topics":77,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fwork-with-named-ranges-and-tables-in-xlwings","Work with Named Ranges and Tables in xlwings","Address data in a live Excel workbook by name instead of by cell address with xlwings: read and write named ranges for inputs and results, list, add and remove names at workbook and sheet scope, read an Excel table into pandas, write a DataFrame back into the table with update() so it resizes, add totals, and create new tables from Python.",[11],{"path":79,"title":80,"description":81,"type":8,"topics":82,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fxlwings-run-macro-from-python-example","xlwings: Run a VBA Macro From Python (Example)","A complete xlwings example for running a VBA macro from Python: open the workbook, bind the Sub with app.macro() or book.macro(), pass arguments, save, and quit Excel.",[36,11],{"path":84,"title":85,"description":86,"type":8,"topics":87,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fchoosing-a-python-excel-library\u002Fwhen-to-use-xlwings-instead-of-openpyxl","When to Use xlwings Instead of openpyxl","xlwings drives a real copy of Excel; openpyxl edits the file. Four jobs justify the cost — recalculation, objects openpyxl drops, live workbooks and native output.",[24,11,88],"openpyxl",{"path":90,"title":91,"description":92,"type":8,"topics":93,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-python-in-excel\u002Fpython-in-excel-vs-openpyxl-and-xlwings","Python in Excel vs openpyxl and xlwings","Python in Excel runs code inside a cell; openpyxl and pandas write files from a script; xlwings drives the Excel application. Compare where each runs, what it can reach and which jobs it suits.",[94,11,24,88],"python-in-excel",1790972052271]