[{"data":1,"prerenderedAt":58},["ShallowReactive",2],{"topic:macros-and-vba":3},[4,13,19,25,31,36,41,47,53],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fadd-a-vba-macro-to-a-workbook-with-xlsxwriter","Add a VBA Macro to a Workbook with xlsxwriter","Ship a macro-enabled .xlsm report from Python: extract a vbaProject.bin once from a workbook saved in Excel, attach it to every new file with xlsxwriter, wire a button to a macro, keep the workbook and sheet code names consistent, and check the result without opening Excel.","how-to",[10,11],"macros-and-vba","xlsxwriter",null,{"path":14,"title":15,"description":16,"type":8,"topics":17,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fextract-vba-macro-code-from-an-excel-file","Extract VBA Macro Code from an Excel File","Read the VBA inside .xlsm, .xlsb and .xls files without opening Excel: detect whether a workbook has macros at all, extract every module with oletools, save them as .bas and .cls files that can be diffed and reviewed in git, inventory the macros across a folder, and flag suspicious code before anyone enables it.",[10,18],"file-formats",{"path":20,"title":21,"description":22,"type":8,"topics":23,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Frun-an-excel-macro-from-python-with-win32com","Run an Excel Macro from Python with win32com","Call existing VBA from Python with Application.Run: qualified macro names, positional arguments, return values, and staging bulk data so the loop runs inside Excel.",[10,24],"com-automation",{"path":26,"title":27,"description":28,"type":8,"topics":29,"kind":12},"\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.",[10,30],"xlwings",{"path":32,"title":33,"description":34,"type":8,"topics":35,"kind":12},"\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.",[30,10],{"path":37,"title":38,"description":39,"type":8,"topics":40,"kind":12},"\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.",[10,30],{"path":42,"title":43,"description":44,"type":8,"topics":45,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fchoosing-a-python-excel-library\u002Fpython-vs-vba-for-excel-automation","Python vs VBA for Excel Automation","When to automate Excel with VBA and when with Python — where each runs, what each is good at, security and deployment, speed on real data, and a side-by-side of the same task in both, plus ways to use them together.",[46,10],"choosing-libraries",{"path":48,"title":49,"description":50,"type":8,"topics":51,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fchoosing-a-python-excel-library\u002Ftranslate-common-vba-macros-to-python","Translate Common VBA Macros to Python","A phrasebook for moving VBA to Python: the eight patterns that make up most Excel macros — finding the last row, looping over rows, deleting rows that match, lookups with a dictionary, filtering and copying, looping over a folder of files, saving a copy with a date, and error handling — each shown in VBA and in pandas or openpyxl.",[10,52],"openpyxl",{"path":54,"title":55,"description":56,"type":8,"topics":57,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fwork-with-macro-enabled-xlsm-files-in-openpyxl","Work with Macro-Enabled .xlsm Files in openpyxl","Edit .xlsm workbooks from Python without destroying the VBA project: the keep_vba flag, why the filename matters, what openpyxl still drops, and how to verify macros survived.",[18,10,52],1790972052271]