Releases: Greedquest/vbInvoke
v1.2.0
What's Changed
🎯 Use MIT by @Greedquest in #5
🎯 Switch to tbShellLib by @Greedquest in #10
- Improved support for returned Type Information with complete ITypeLib interface
- Purge a load of dead code
- This is helped by the switch to fafalone/tbShellLib for common interfaces
- Fix logging of the linked list pointers (see #7 )
- Add Readme
- Treat .twin files as VBA (#8)
Full Changelog: v1.1.0...v1.2.0
v1.1.0
Full Changelog: v1.0.1...v1.1.0
Fix code to work in 32-bit and 64-bit saved & unsaved
v1.0.1
Full Changelog: v1.0.0...v1.0.1
Fixed faulty ITypeLib definition so that this works on 32-bit
Note:
- 64-bit xlsm must be saved and re-opened
- 32-bit xlsm must be saved and have mature content
Otherwise this technique doesn't seem to pick up the parent typelib name and will raise an error
v1.0.0
First public release. Has 2 main methods and 2 ways of calling them:
ActiveX DLL (Tools⇒Add Reference
)
Function GetStandardModuleAccessor(ByVal moduleName As String, ByVal proj As VBProject) As Object
Function GetExtendedModuleAccessor(ByVal moduleName As String, ByVal proj As VBProject, Optional ByRef outPrivateTI As [_ITypeInfo]) As Object
Standard DLL Declare
Declare PtrSafe Function GetStandardModuleAccessor Lib "vbInvoke_win64" (ByVal moduleName As Variant, ByVal proj As VBProject) As Object
Declare PtrSafe Function GetExtendedModuleAccessor Lib "vbInvoke_win64" (ByVal moduleName As Variant, ByVal proj As VBProject, ByRef outPrivateTI As IUnknown) As Object
Note: The standard DLL version uses Variant
for the module name and has no optional arguments
These 2 functions create "Accessors": IDispatch
Objects that can be used with dot notation accessor.Foo
or call by name CallByName(accessor, "Foo", ...)
to invoke
- Public methods/functions/properties of modules (Standard Accessor)
- Public or Private methods/functions/properties (Extended Accessor)
You can also use the Extended Accessor in a For-Each loop to print all the public & private methods (although this API may change to be more useful):
Dim exampleModuleAccessor As Object
Set exampleModuleAccessor = GetExtendedModuleAccessor("ExampleModule", ThisWorkbook.VBProject)
For Each methodName In exampleModuleAccessor
CallByName exampleModuleAccessor, methodName, vbMethod
Next methodName
Finally you can reference this library as a .twinpack
. This library only works when compiled into in-process DLLs or VBE Addins - it cannot be used to create a standalone EXE as it relies on sharing memory with the active VBProject.