ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Minimize Form (https://www.excelbanter.com/excel-programming/331318-minimize-form.html)

[email protected]

Minimize Form
 
I've programmed a Form in Excel 1997. When the form is activated for
data entry, it takes up the entire screen with the excel workbook
behind the scenes. Someone asked me if there was a way they could
"minimize" the Form so they can work on other applications, multi-task.
To work on other applications, they currently have to exit the Form by
clicking on the red X in the upper right hand corner of the Form. This
shuts down the form completely.

Is there a way I can program the Form to be minimized, just like I
might minimize Microsoft Word so I can work on something else? I don't
want to have to shut down the form to work with other software.
Ideally, I'd like to be able to easily toggle from my Form to any other
open application. I'd also like to toggle from an open application,
like Word, to my Form.

Any assistance you can provide would be greatly appreciated. Thanks.

Michael


Tushar Mehta

Minimize Form
 
One doesn't have to minimize a XL form to work with other applications.
And, one cannot work with XL97 while a form is displayed, minimized or
otherwise.

To switch to another application use the Windows taskbar. By default
it is at the bottom of the screen. or use ALT+TAB to cycle through all
running applications.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article .com,
says...
I've programmed a Form in Excel 1997. When the form is activated for
data entry, it takes up the entire screen with the excel workbook
behind the scenes. Someone asked me if there was a way they could
"minimize" the Form so they can work on other applications, multi-task.
To work on other applications, they currently have to exit the Form by
clicking on the red X in the upper right hand corner of the Form. This
shuts down the form completely.

Is there a way I can program the Form to be minimized, just like I
might minimize Microsoft Word so I can work on something else? I don't
want to have to shut down the form to work with other software.
Ideally, I'd like to be able to easily toggle from my Form to any other
open application. I'd also like to toggle from an open application,
like Word, to my Form.

Any assistance you can provide would be greatly appreciated. Thanks.

Michael



dominicb[_21_]

Minimize Form
 

Good afternoon Michael

Use this before your first procedure in the userforms code:

Private Declare Function SetWindowLong& Lib "user32" Alias
"SetWindowLongA" (ByVal hwnd&, ByVal nIndex&, ByVal wNewWord&)
Private Declare Function FindWindow& Lib "user32" Alias "FindWindowA"
(ByVal lpClassName As String, ByVal lpWindowName As String)
Public usrcell As String

and then just add this in to your Userform_Initialize event (or just
add it to the bottom of your code if you don't have one).

Private Sub UserForm_Initialize()
Dim hwnd&
hwnd = FindWindow(vbNullString, Me.Caption)
SetWindowLong hwnd, -16, &H84CA0080
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=377685



All times are GMT +1. The time now is 03:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com