![]() |
![]() |
|
|||||||
| 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: Mar 2002
Posts: 49
|
Hi all,
I have UserForm1 in my workbook. Is there a way such that whenever the workbook is opened, UserForm1 is displayed, and Excel minimised. Also, any similar techniques for MS-Word?? Thanks a bunch.. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Mar 2002
Posts: 11
|
Hi,
Go to VBA Editor, add these codes to ThisWorkbook/ThisDocument object. For Excel: Private Sub Workbook_Open() Application.WindowState = wdWindowStateMinimize Load UserForm1 UserForm1.Show End Sub For MS-Word: Private Sub Document_Open() Application.WindowState = wdWindowStateMinimize Load UserForm1 UserForm1.Show End Sub |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Posts: 47
|
Try this
Copy it into the "this workbook module" It is an auto open macro that runs anytime the workbook is opened. To bypass it - hold down the shift when you open the workbook Private Sub Workbook_Open() ActiveWindow.WindowState = xlMinimized Application.ScreenUpdating = False Call "procedure that loads your form" Application.ScreenUpdating = True End Sub Good luck |
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi John,
In your Workbook_Open routine, include the following: ActiveWindow.WindowState = xlMinimized UserForm1.Show ActiveWindow.WindowState = xlMaximized When you dismiss the userform, the window state is is maximized (use xlNormal to return to the visible, non-max state). Note that you cannot use Application.WindowState = xlMinimized to hide Excel from view and then work with the userform, you can only minimize the active windows. HTH, Jay |
|
|
|
|
|
#5 |
|
New Member
Join Date: Feb 2002
Location: ]-[ /-\ \/\/ /-\ | | ~~~@|_()]-[/-\!!!
Posts: 48
|
Or, yet another way which I use to hide Excel when opening a workbook with a custom password dialog:
Application.Visible = False 'do your thingy Application.Visible = True this hides Excel completely, then shows it when invoking "True." Aloha! |
|
|
|
|
|
#6 | |
|
Board Regular
Join Date: Mar 2002
Location: Little Italy
Posts: 93
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|