![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: Jason in Boston MA
Posts: 12
|
Does anyone know if there is a way to hide the entire excel window or to minimize it so that only a userform will be seen on the desktop?
|
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
This makes excel not hide but minimized:
Private Sub UserForm_Activate() Application.WindowState = xlMinimized End Sub Private Sub UserForm_Deactivate() Application.WindowState = xlNormal End Sub And you should use UserForm1.Show vbModeless to show userform regards |
|
|
|
|
|
#3 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
You can set Userform's Showmodal property to false in design view_properties window if you dont want to use UserForm1.Show vbModeless. Just same...
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Location: Jason in Boston MA
Posts: 12
|
Thanks for the code This should make things look a lot cleaner.
|
|
|
|
|
|
#5 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
It makes me happy if you can solve your problem with this way.
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Apr 2002
Location: Jason in Boston MA
Posts: 12
|
code works great but is there a way to make all windows (other programs)that are open minimize?
|
|
|
|
|
|
#7 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
If you are not closer to APIs then this should be a little confused what it does but just does what you want.
Open the user form module and paste this codes. 'These two lines should be placed on declaration Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Dim currState Private Sub UserForm_Activate() currState = Application.WindowState Call MinimizeAll Application.WindowState = currState Application.WindowState = xlMinimized UserForm1.Show vbModeless End Sub Private Sub MinimizeAll() Call keybd_event(&H5B, 0, 0, 0) Call keybd_event(77, 0, 0, 0) Call keybd_event(&H5B, 0, &H2, 0) End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Application.WindowState = currState End Sub regards |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|