fxVBA — VBA/Access Compatibility¶
Functions with names and behaviors matching VBA and Microsoft Access, designed for developers migrating from the Microsoft Office ecosystem.
Submodules¶
| Submodule | Purpose |
|---|---|
string_functions |
Left, Right, Mid, InStr, Len, Trim, etc. |
math_functions |
Abs, Int, Fix, Sgn, Sqr, etc. |
date_functions |
DateAdd, DateDiff, DatePart, etc. |
conversion_functions |
CStr, CInt, CDbl, CBool, etc. |
format_functions |
Format, FormatNumber, FormatCurrency, etc. |
logic_functions |
IIf, Switch, Choose, etc. |
financial_functions |
DDB, SLN, SYD, Rate, etc. |
array_functions |
Array, UBound, LBound, Split, Join, etc. |
misc_functions |
TypeName, IsNumeric, IsDate, etc. |
system_functions |
Environ, Timer, etc. |
Quick Examples¶
from shortfx import fxVBA
text = "Hello World"
# String functions (1-based indexing, like VBA)
start = fxVBA.Left(text, 5) # "Hello"
position = fxVBA.InStr(1, text, "World") # 7
# Type conversions
value = fxVBA.CInt("42") # 42
flag = fxVBA.CBool(1) # True
# Conditional
result = fxVBA.IIf(10 > 5, "Yes", "No") # "Yes"
Note
Function names use PascalCase to match VBA conventions (e.g., InStr, not instr).