# Visual Basic > Office Development >  [RESOLVED] hInstance?

## fafalone

I was surprised there were no results I could find for this. 

How do I get the hInstance in VBA? The only answer I've seen is Application.hInstance, but this does not seem to be valid outside of Excel.

----------


## wqweto

Check out if *GetModuleHandle(NULL)* matches *App.hInstance* in Excel and use it instead in other VBA hosts.

cheers,
</wqw>

----------


## fafalone

Application.hInstance doesn't work in Excel either (present but fails), but it does seem to match hInstancePtr, thanks.

----------

