LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Input Box won't show when Application windowstate minimised

Hi KeepitCool

Your code works fine, and I can use input boxes when Excel is not visible.

Is there anyway of replicating the +ACI-minimise all windows+ACI- you can do with
the +ACI-Windows+ACI-key and M+ACI-, or similar commands for other open aplpications
like the one in your code that closes the VBE window?

I have had some success with GetObject +ACY- CreateObject using the visible
property, but I would have to write a very long list of apps users +ACI-might+ACI-
have open on their PC, so this is fraught with danger?

Is there a simple way to minimise or hide everything (all open windows), so
that you always see the form?

Cheers

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Prevent Duplicate Data from inputing using input application? Zigball Excel Discussion (Misc queries) 1 October 10th 06 05:56 PM
How to Prevent Duplicate Data from inputing using input application? Zigball New Users to Excel 1 October 10th 06 05:31 PM
nice input application form יונתן Charts and Charting in Excel 0 July 4th 06 03:49 PM
Input Box won't show when Application windowstate minimised Joe 90[_2_] Excel Programming 0 October 21st 03 01:48 AM
Input Box won't show when Application windowstate minimised Joe 90[_2_] Excel Programming 1 October 21st 03 01:22 AM


All times are GMT +1. The time now is 09:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"