I have sort of painted myself into a corner with creating a pretty in-depth vba project and my "hack" is to hide the workbook behind the userform. I know, I know, I should have used VB Studio since I'm trying to emulate a "standalone" application. Regardless, what I have I can insert into each userform module. I'm wondering how I could make this a public sub and call it from the userform. Is this even possible or would there be caveats to this approach? I've tried using Dim uForm as UserForm and substituting Me with uForm but that didn't work.
Code:
Private Sub HideApp()
Dim wbName As String
Set wb = ThisWorkbook
Set ws = wb.Sheets(1)
wbName = ws.Range("D4")
On Error GoTo Err
Application.ScreenUpdating = False
With Windows(wbName)
.WindowState = xlNormal
.Top = Me.Top
.Left = Me.Left
.Height = Me.Height
.Width = Me.Width
End With
Application.ScreenUpdating = True
Err:
Application.ScreenUpdating = True
End Sub