Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default showing userform with excel minimized

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default showing userform with excel minimized

How about just hiding excel when you load the form. The showing it when you
exit the userform.

Option Explicit
Private Sub CommandButton1_Click()
Application.Visible = True
Unload Me
End Sub
Private Sub UserForm_Initialize()
Application.Visible = False
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Call CommandButton1_Click
End Sub

Commandbutton1 was the button to close the userform.



JNW wrote:

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default showing userform with excel minimized

worked like a charm. thanks

"Dave Peterson" wrote:

How about just hiding excel when you load the form. The showing it when you
exit the userform.

Option Explicit
Private Sub CommandButton1_Click()
Application.Visible = True
Unload Me
End Sub
Private Sub UserForm_Initialize()
Application.Visible = False
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Call CommandButton1_Click
End Sub

Commandbutton1 was the button to close the userform.



JNW wrote:

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default showing userform with excel minimized

To add to this post in case any one is searching this. I have found some
code online that hides excel, but also adds a minimize button on the userform
and shows the userform in the taskbar. The website is:
http://puremis.net/excel/code/063.shtml

JNW

"JNW" wrote:

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default showing userform with excel minimized

I really need to minimize excel while the userform is open like you stated
here. I cannot get this to work. Where do I need to put this code? Thanks a
bunch for any help.

"Dave Peterson" wrote:

How about just hiding excel when you load the form. The showing it when you
exit the userform.

Option Explicit
Private Sub CommandButton1_Click()
Application.Visible = True
Unload Me
End Sub
Private Sub UserForm_Initialize()
Application.Visible = False
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Call CommandButton1_Click
End Sub

Commandbutton1 was the button to close the userform.



JNW wrote:

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default showing userform with excel minimized

Can anyone post the code from this site here? The website is blocked at my
location.

"JNW" wrote:

To add to this post in case any one is searching this. I have found some
code online that hides excel, but also adds a minimize button on the userform
and shows the userform in the taskbar. The website is:
http://puremis.net/excel/code/063.shtml

JNW

"JNW" wrote:

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default showing userform with excel minimized

http://puremis.net/excel/code/063.shtml says:

Option Explicit

'API functions
Private Declare Function GetWindowLong Lib "user32" _
Alias "GetWindowLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As
Long
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hWnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As
Long
Private Declare Function GetActiveWindow Lib "user32.dll" _
() As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function DrawMenuBar Lib "user32" _
(ByVal hWnd As Long) As Long


'Constants
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const GWL_EXSTYLE = (-20)
Private Const HWND_TOP = 0
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_HIDEWINDOW = &H80
Private Const SWP_SHOWWINDOW = &H40
Private Const WS_EX_APPWINDOW = &H40000
Private Const GWL_STYLE = (-16)
Private Const WS_MINIMIZEBOX = &H20000
Private Const SWP_FRAMECHANGED = &H20
Private Const WM_SETICON = &H80
Private Const ICON_SMALL = 0&
Private Const ICON_BIG = 1&

--------------------------------------------------------------------------------


Private Sub UserForm_Activate()
AddIcon 'Add an icon on the titlebar
AddMinimiseButton 'Add a Minimize button to Userform
AppTasklist Me 'Add this userform into the Task bar
End Sub

--------------------------------------------------------------------------------

Private Sub AddIcon()
'Add an icon on the titlebar
Dim hWnd As Long
Dim lngRet As Long
Dim hIcon As Long
hIcon = Sheet1.Image1.Picture.Handle
hWnd = FindWindow(vbNullString, Me.Caption)
lngRet = SendMessage(hWnd, WM_SETICON, ICON_SMALL, ByVal hIcon)
lngRet = SendMessage(hWnd, WM_SETICON, ICON_BIG, ByVal hIcon)
lngRet = DrawMenuBar(hWnd)
End Sub

--------------------------------------------------------------------------------

Private Sub AddMinimiseButton()
'//Add a Minimize button to Userform
Dim hWnd As Long
hWnd = GetActiveWindow
Call SetWindowLong(hWnd, GWL_STYLE, _
GetWindowLong(hWnd, GWL_STYLE) Or _
WS_MINIMIZEBOX)
Call SetWindowPos(hWnd, 0, 0, 0, 0, 0, _
SWP_FRAMECHANGED Or _
SWP_NOMOVE Or _
SWP_NOSIZE)
End Sub

--------------------------------------------------------------------------------

Private Sub AppTasklist(myForm)
'Add this userform into the Task bar
Dim WStyle As Long
Dim Result As Long
Dim hWnd As Long

hWnd = FindWindow(vbNullString, myForm.Caption)
WStyle = GetWindowLong(hWnd, GWL_EXSTYLE)
WStyle = WStyle Or WS_EX_APPWINDOW
Result = SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, _
SWP_NOMOVE Or _
SWP_NOSIZE Or _
SWP_NOACTIVATE Or _
SWP_HIDEWINDOW)
Result = SetWindowLong(hWnd, GWL_EXSTYLE, WStyle)
Result = SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, _
SWP_NOMOVE Or _
SWP_NOSIZE Or _
SWP_NOACTIVATE Or _
SWP_SHOWWINDOW)
End Sub

--------------------------------------------------------------------------------

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As
Integer)
Application.Visible = True
End Sub



And you need to place the following in a standard module to show a
userform.

Option Explicit

--------------------------------------------------------------------------------

Sub Auto_Open()
Application.Visible = False
UserForm1.Show
End Sub


ocean wrote:
Can anyone post the code from this site here? The website is blocked at my
location.

"JNW" wrote:

To add to this post in case any one is searching this. I have found some
code online that hides excel, but also adds a minimize button on the userform
and shows the userform in the taskbar. The website is:
http://puremis.net/excel/code/063.shtml

JNW

"JNW" wrote:

The userforms I have created are filled in with information from the
internet.

Is there a way to have the userform open in the bottom-right hand corner.
(I can get it to open in the top-left)

Also, I would like the user to be able to see the internet browser
underneath the user form but can't find away to have the userform open with
the excel window minimized.

Thanks


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Normal Use of a Worksheet With a UserForm Showing? jennie Excel Programming 2 September 20th 04 12:59 PM
Excel 2003 - Showing Userform Steve Jones Excel Programming 8 July 30th 04 07:58 AM
Excel VBA question - showing userform when opening workbook ajliaks Excel Programming 2 April 12th 04 06:24 PM
Showing a userform based on a condition. Pete Excel Programming 1 January 26th 04 05:34 PM
REPOST: showing a userform boris Excel Programming 2 August 6th 03 02:30 AM


All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"