Function Windows API Class

GetModuleFileName

Return the file name of the program associated with the Windows Module Handle vModuleHandle.

Signature (Visual Basic / VBA)

Public Function GetModuleFileName( _
    ByVal vModuleHandle As Variant _
    ) As Variant

Code Example

    GetModuleFileName(est.hInstance) = "C:\VB\VB32.EXE"

Parameters

Parameter Description
vModuleHandle Windows Module Handle for the program whose file name will be returned. Function returns Null if vModuleHandle is Null or cannot be fixed-up to a number.

Notes & Version History

Note You will likely get a different result when running this example.
v1.3 Change Removed 16-bit support from this function.