PDA

View Full Version : Solved: show very hidden



fgarcia90
07-13-2012, 09:16 AM
I have a form with a botton that when click it should show and let edit.
note: the application is not visible and the sheet is veryhidden
what appens is that it show but doen't let edit...




Private Sub CommandButton4_Click()
Application.Visible = True
Sheet2.Visible = xlSheetVisible
Sheet2 = Focus
End Sub


thanks is adanced

Kenneth Hobs
07-13-2012, 09:29 AM
It has to do with how you Show the Userform. Set the ShowModal property in the Userform or use the 2nd parameter of the Userform's Show method for vbModeless. e.g.

Userform1.Show vbModeless

fgarcia90
07-13-2012, 09:41 AM
no, but as the excel is not visible tried

Private Sub CommandButton4_Click()
form_user_inicial_tecnica.Hide
Application.Visible =
True
End Sub


and a macro to return to the begining with :


Option Explicit

Sub
SaveDocument_e_voltar()
Application.ActiveWorkbook.Save
Application.Visible = False
Module1.seccao
End Sub



and is working fine :)

Kenneth Hobs
07-13-2012, 09:48 AM
After all that, you need to Activate or Select the sheet and then Select a cell Range. e.g.
application.WindowState=xlNormal
Sheet1.Activate
Range("A1").Select

Obviously, if the application has not be set to visible the window state is not set, the userform is modal, you will have those issues.

fgarcia90
07-13-2012, 10:03 AM
thanks

I have a thread (http://www.vbaexpress.com/forum/showthread.php?t=42949) still open with a need of solution, want to help in that :)
thanks