Thread: Forms Display
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Forms Display

Zak,

Try the following, for Excel 2000 and later.

Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Declare Function SetForegroundWindow Lib "user32" ( _
ByVal hwnd As Long) As Long

Sub ShowTheForm()
Dim FHwnd As Long
Load UserForm1
FHwnd = FindWindow("ThunderDFrame", UserForm1.Caption)
If FHwnd Then
SetForegroundWindow FHwnd
End If
UserForm1.Show
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"ZAK" wrote in message
...
Hi

I am displaying a warning form for a user when the cell
reaches a critical value. However I would like the form to
be at the forefront of all windows application, so that
the user has to acknowledge before he can resume to use
the computer. I am thinking in cases where the Excel is
minimised.

Regards

ZAK