What Converts Automatically vs. What Needs Manual Work
No converter handles 100% of VBA. Here's an honest breakdown of what our engine does well, what it flags for review, and what still needs a human.
How Our Converter Works
The converter is a deterministic, rule-based engine. No AI, no LLMs, no guessing. It processes your VBA through a 4-stage pipeline:
Blocks
Multi-line structures (If, For, Select Case, With)
Chains
Dot-chained expressions (.Range, .Value, .Interior)
Lines
Individual statements, functions, operators
Cleanup
Indentation, imports, helper injection
When the converter encounters a pattern it doesn't have a rule for, it flags it with a warning comment instead of guessing. This means you always know exactly what needs manual attention.
Fully Automated Conversions
EasyThese patterns convert cleanly with no manual intervention. The output is production-ready.
| Pattern | VBA | Python | Status |
|---|---|---|---|
| Control Flow | If/ElseIf/Else, For/Next, For Each, Do While/Until, Select Case | if/elif/else, for/range, while | Full |
| Function Definitions | Sub/Function with params | def with ws param injection | Full |
| String Functions (19) | Trim, UCase, LCase, Len, Left, Mid, Right, InStr, Replace, Split, Join, etc. | .strip(), .upper(), slicing, .find(), etc. | Full |
| Math Functions (9) | Abs, Int, Sqr, Round, Rnd, Log, Exp, Sgn | abs(), int(), math.sqrt(), round(), etc. | Full |
| Type Functions (12) | CStr, CInt, CLng, CDbl, CBool, IsEmpty, IsNull, IsDate, Val, TypeName | str(), int(), float(), bool(), etc. | Full |
| Date/Time (11) | Now, Year, Month, Day, Hour, Minute, Second, DateAdd, etc. | datetime module | Full |
| Constants (12) | vbCrLf, vbTab, vbNewLine, True, False, Nothing, Empty, Null | "\r\n", "\t", "\n", True, False, None | Full |
| Operators | & , <>, And, Or, Not, = | +, !=, and, or, not, == | Full |
| Comments | ' and Rem | # | Full |
| Variable Declarations | Dim x As Type | # comment (Python doesn't need declarations) | Full |
Converted with Warnings
ModerateThese patterns produce working Python but may need manual review. The converter adds # TODO or # WARNING comments where you should double-check the output.
| Pattern | What Happens | Notes |
|---|---|---|
| Range("A1").Value | ws["A1"].value | Works for simple ranges |
| Cells(r,c).Value | ws.cell(row=r, column=c).value | Named params for clarity |
| .Interior.Color = RGB() | PatternFill() | Only RGB format supported |
| WorksheetFunction.Sum/Min/Max | sum(), min(), max() | Simple mappings work |
| WorksheetFunction.VLookup/Match/Index | Helper stubs with TODO | Needs manual implementation |
| CreateObject("Scripting.Dictionary") | {} | Methods mapped (.Item→[], etc.) |
| CreateObject("Scripting.FileSystemObject") | import os | 10 method mappings |
| On Error GoTo <label> | try/except block | Structure converted, verify logic |
| On Error Resume Next | # TODO comment | Must manually wrap risky lines |
| Call SubName(args) | SubName(ws, args) | Auto ws injection |
| Exit Sub/Function | return | Clean mapping |
| Exit For/Do | break | Clean mapping |
Flagged for Manual Implementation
HardThese patterns are too context-dependent for automated conversion. The converter flags them with comments so you know exactly where to focus manual effort.
| Pattern | Why It's Hard | What We Do |
|---|---|---|
| .Find() / .FindAll() | Complex search with multiple optional params | Flag with warning |
| .Sort() | Multi-key sorting with custom orders | Flag with warning |
| .AutoFilter() | Interactive Excel feature, no openpyxl equivalent | Flag with warning |
| GoTo (non-error) | No structured Python equivalent | Comment with TODO |
| ReDim Preserve | Dynamic array resizing mid-loop | Comment with TODO |
| .Copy/.Paste/.PasteSpecial | Clipboard operations don't exist in openpyxl | Not yet handled |
| .Offset/.Resize | Relative references need context | Not yet handled |
| .Font.Bold/.Size/.Color | openpyxl Font() object has different API | Not yet handled |
| .NumberFormat | Excel format strings ≠ Python format strings | Not yet handled |
Currently Not Supported
Very HardThese patterns require fundamental restructuring that goes beyond line-by-line conversion. They need a human developer who understands both the VBA architecture and the target Python design.
| Pattern | Why |
|---|---|
| Class Modules | VBA classes → Python classes requires OOP restructuring |
| UserForms | GUI dialogs have no direct Python equivalent |
| ActiveX Controls | COM-based UI components |
| Workbook Events (Workbook_Open, etc.) | Event-driven model doesn't map to scripts |
| External COM Objects (Outlook, Word, etc.) | Each needs its own Python library |
| Multi-sheet operations | Converter assumes single worksheet context |
| Array formulas | Require understanding of Excel's calculation engine |
The Numbers
Current converter coverage at a glance:
53
VBA functions
mapped to Python (from 5 categories)
12
VBA constants
mapped to Python equivalents
10+
COM patterns
mapped (Dictionary, FSO, WorksheetFunction)
13
Control flow constructs
mapped (If, For, While, Select Case, With, etc.)
115
Automated tests
ensuring conversion accuracy
4
Pipeline stages
Blocks, Chains, Lines, Cleanup
Related Guides
- Complete Syntax Mapping Reference — Every VBA construct mapped to Python side-by-side.
- Excel VBA to Python with openpyxl — Practical examples of Range, Cells, and worksheet operations.
- VBA String Functions to Python — Trim, Left, Mid, InStr, Replace with edge cases.
- VBA Loops to Python — For, For Each, Do While/Until with range adjustments.
Try It Yourself
Paste any VBA macro and see what converts automatically. The output flags everything that needs manual attention with clear TODO comments.