Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks keepitcool
It'll take me a couple of weeks to figure out what you have written (lol), but I'll give it a go. Thanks again Joe +ACI-keepitcool+ACI- +ADw-xrrcvgpbby+AEA-puryyb.ay+AD4- wrote in message news:Xns941B17D74E9C8keepitcoolnl+AEA-207.46.248.16... Joe.. All of what you want can be achieved+ACE- This demo show's what's happening with the form's events.. And instead of minimising, we're hiding excel completely+ACE- Be very carefull IF your code crashes... NO way to make the session visible again. I've included the messagebox to show the event gets triggered Plus I've added an application.inputbox type 8(range reference) for the demo Put this in a userform with a commandbutton and a textbox wide enough to hold a fully qualified range address Written in excelXP and tested in Excel97, Works well with Modal and Modeless userforms. Option Explicit Private Sub CommandButton1+AF8-Click() On Error GoTo exitH Me.Hide If InputBox(+ACI-Type the password+ACI-) +AD0- +ACI-wp+ACI- Then Application.Visible +AD0- True ActiveWorkbook.Worksheets(2).Activate Me.TextBox1.Text +AD0- Application.InputBox( +AF8- Prompt:+AD0AIg-Now select a range+ACI-, Type:+AD0-8).Address(external:+AD0-True) Me.TextBox1.Visible +AD0- True Else MsgBox +ACI-Wrong password.. it's: wp in lowercase+ACI- End If exitH: If Err +ADwAPg- 0 Then MsgBox +ACI-ERROR on commandclick+ACEAIg- +ACY- vbNewLine +ACY- +AF8- Err.Description Me.Show 'this activates thus hides excel+ACE- End Sub Private Sub UserForm+AF8-Activate() Application.Visible +AD0- False Debug.Print +ACI-form activated+ACI- End Sub Private Sub UserForm+AF8-Initialize() On Error GoTo errH Application.VBE.MainWindow.Visible +AD0- False Me.CommandButton1.Caption +AD0- +ACI-Get the range+ACI- +ACY- vbNewLine +ACY- +ACI-(pw protected)+ACI- Me.CommandButton1.AutoSize +AD0- True Me.TextBox1.Visible +AD0- False Me.Caption +AD0- +ACI-Demo by keepITcool+ACI- Debug.Print +ACI-form initialized+ACI- Exit Sub errH: MsgBox +ACI-An error occurred during the form's init+ACI- +ACY- vbNewLine +ACY- Err.Description Application.Visible +AD0- True End End Sub Private Sub UserForm+AF8-QueryClose(Cancel As Integer, CloseMode As Integer) Debug.Print +ACI-form closed ,+ACI-cancel:+ACIAOw- Cancel, +ACI-closemode:+ACIAOw- CloseMode 'we have terminate to handle the close End Sub Private Sub UserForm+AF8-Terminate() Application.Visible +AD0- True Application.VBE.MainWindow.Visible +AD0- True Debug.Print +ACI-form terminated+ACI- End Sub Have fun... keepITcool +ADw- email : keepitcool chello nl (with +AEA- and .) +AD4- +ADw- homepage: http://members.chello.nl/keepitcool +AD4- +ACI-Joe 90+ACI- +ADw-joe+AEA-sillyspambimma.me.uk(remove silly spam)+AD4- wrote: +AD4- There is probably nothing that can be done about this, but when using +AD4- Application.Windowstate xlminimised, to run a form, I have a input box +AD4- to close the form with a password, but cannot see it (even though you +AD4- can still type the password). Do I have to use another userform to +AD4- handle this problem. +AD4- +AD4- Also is there any way to bring the form to the front of any other +AD4- windows that might be open, when minimising the spreadsheet? +AD4- +AD4- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to Prevent Duplicate Data from inputing using input application? | Excel Worksheet Functions | |||
How to Prevent Duplicate Data from inputing using input application? | Excel Discussion (Misc queries) | |||
How to Prevent Duplicate Data from inputing using input application? | New Users to Excel | |||
nice input application form | Charts and Charting in Excel | |||
Input Box won't show when Application windowstate minimised | Excel Programming |