Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I suspect you can only run
Form1.Hide when Form1 is open. I'm getting run time error 380, even with On Error GoTo 0 Form1.Hide On Error Resume Next So, how do you determine if Form1 is Open, so the Hide command can be conditional ? Thanks - Kirk |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if form1.visible then
Form1.Hide endif "kirkm" wrote: I suspect you can only run Form1.Hide when Form1 is open. I'm getting run time error 380, even with On Error GoTo 0 Form1.Hide On Error Resume Next So, how do you determine if Form1 is Open, so the Hide command can be conditional ? Thanks - Kirk |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if form1.visible then
That would load the form causing it's initialize event to run if the form was not already loaded. Sub test() Dim frm As UserForm If Form1.Visible Then Form1.Hide End If For Each frm In UserForms If frm Is Form1 Then If Form1.Visible Then Form1.Hide End If 'to destroy the form as well ' Unload frm ' or Unload Form1 ' these will trigger Queryclose and, if not Cancel= true in Queryclose, Terminate events End If Next End Sub Sub showform() ' userform named Form1 Form1.Show vbModeless End Sub Regards, Peter T "Harbinger" wrote in message ... if form1.visible then Form1.Hide endif "kirkm" wrote: I suspect you can only run Form1.Hide when Form1 is open. I'm getting run time error 380, even with On Error GoTo 0 Form1.Hide On Error Resume Next So, how do you determine if Form1 is Open, so the Hide command can be conditional ? Thanks - Kirk |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using a template form, advance a form number everytime you open | Excel Discussion (Misc queries) | |||
Hiding a form | Excel Programming | |||
User form and hiding spreadsheet | Excel Discussion (Misc queries) | |||
Form not hiding | Excel Discussion (Misc queries) | |||
Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form? | Excel Programming |