Show userform upon maximizing from tray

Garbo

New Member
Joined
Apr 5, 2002
Messages
3
Hi,

I have a part number cross reference spreadsheet in XL97 that is in continual use during the work day. It contains around 3000 entries.

When opened, the userform is displayed and the user can obtain the appropriate cross reference. To keep it readily available, there is a 'Hide' button that hides the userform and minimizes the spreadsheet to the tray to keep it readily available.

Is it possible to create a macro to automatically show the userform when the spreadsheet is maximized from the tray by clicking its icon?

Thanks for any suggestions that you may have.

Garbo
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
In Thisworkbook object:

Private Sub Workbook_Activate()
UserForm.Show
End Sub

I hope it works for you.
regards
 
Upvote 0
Smozgur,

No luck. It would seem that the workbook is already activated and is simply minimized to the tray.

Nonetheless, thank you for your response. I do appreciate you taking the time.
 
Upvote 0
Hi Garbo

Try this

Private Sub Workbook_WindowResize(ByVal Wn As Window)

If ActiveWindow.WindowState = xlMaximized Then
UserForm1.Show
End If

End Sub
 
Upvote 0
Dave,

Thanks for your reply. I have followed your posts for a long time, and have learned a great deal from your offerings.

I tried your suggestion, which appears to be the solution , but it still does not show the form when maximized from the tray.

It appears that I may just have to live with using a cmd button to show the form.

Thanks again.

Garbo
 
Upvote 0
Hey Garbo
I tried everything I could.
It seems that these events will only fire if the workbook itself is minimized, not Excel as the application itself.
I'll see if there is an API routine if I get extremely bored.
Ha Ha
Tom
 
Upvote 0

Forum statistics

Threads
1,213,530
Messages
6,114,162
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top