Search code examples
exceluserformz-ordervba

Excel 2007: Modelsss UserForm Z-Order


I am creating a series of Excel 2007 modeless userforms that I'd like to .Show and .Hide as needed. The issue I'm trying to understand is how to change their z-order programmatically using VBA. Does anyone have any suggestions or can you point me to a solution?

Thanks -


Solution

  • After a lot of research I ultimately wound up using the Windows API to manage VBA userform Z-order. Specifically, the SetWindowPos API function handles window Z-order with its hWndInsertAfter parameter. I never found any native VBA methods or properties that could set userform Z-order (but I may have missed something).