PDA

View Full Version : [SOLVED] Show userform without showing excel



kevvukeka
06-17-2014, 03:14 AM
Hi All,

I have created a userform to collect data from multiple people with whom I work. The userform is working fine, but I want to know if I can hide the excel.

I added the following lines:



Private Sub Workbook_Open()
Application.WindowState = xlMinimized
TSUF.Show vbModeless
End Sub




but this keeps the excel minimized on the taskbar. Is there a way , I can completely hide the workbook associated with this userform only.

Thanks for your time.

- Praveen-

GTO
06-17-2014, 04:01 AM
...but I want to know if I can hide the excel...

...Is there a way , I can completely hide the workbook associated with this userform only...


Hi there,

If you are wanting to hide Excel (the Application) then you could use Application.Visible. If wanting to hide just the workbook with the code in it, while there is no .Visible property for the workbook, there is a .IsAddin property, which seems to do the same thing to me?

In a new workbook, a UserForm named UserForm1.

In the form's module:


Option Explicit

Private Sub UserForm_Initialize()
ThisWorkbook.IsAddin = True
End Sub

Private Sub UserForm_Terminate()
ThisWorkbook.IsAddin = False
End Sub


In a Standard Module:


Option Explicit

Sub test()
Dim frmMyForm As UserForm1

Set frmMyForm = New UserForm1
frmMyForm.Show

End Sub

Warning: Not really tested, and if you have any code in the form that hides, but does not unload the form, users will have lost access to the now invisible workbook.

Mark