r/vba • u/kay-jay-dubya • 16h ago
Show & Tell vbaXray v2.2 - The FRX Enigma
vbaXray is a single VBA class module that extracts VBA source code straight out of Office files.
I posted about v1.0 a few months back, with an update a few weeks back outlining improved performance and file format support, and now the current version addresses that annoying elephant in the room - FRX files.
Now, just a short note to let you know that vbaXray now exports valid, importable FRX files alongside their corresponding FRM sibling files. Both files are required for importing Userforms into projects.
And for anyone with a burning desire to know what projects are referenced in a file, this information is now available too (except for Access files, at present).
Sub XrayDemo()
Dim xray As New clsVBAXray
If xray.LoadFromFile("C:\ShowMeTheCode\ThisIsYourWorkbookName.xlsm") Then
Debug.Print "Project: " & xray.ProjectName
Debug.Print "Modules: " & xray.ModuleCount
xray.ExportAll "C:\OutputCodeHere\ExtractedCode\"
xray.DebugDumpStorageTree
Else
Debug.Print "Load failed: " & xray.LastError
End If
End Sub
I've also applied various fixes to make exported modules/classes from Access files actually importable again.
The code, some basic documentation, and a (very simple) demo workbook are already on GitHub: