Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Taskbar and applications

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Taskbar and applications

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Taskbar and applications

That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Taskbar and applications

Sorry,

Application.WindowState = xlMaximize

"Geoff" wrote:

That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Taskbar and applications

isn't there still supposed to be a d on the end?
Application.WindowState = xlMaximized
--


Gary


"JLGWhiz" wrote in message
...
Sorry,

Application.WindowState = xlMaximize

"Geoff" wrote:

That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a
userform.
If the file is minimised and the user clicks the cmdbutton again, the
code
checks to see if it is already open and prevents multiple instances. At
this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Taskbar and applications

It is not an execel application though and xlmaximize is not recognised
Here is my code

Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess
As Long, _
ByVal bInheritHandle As
Long, _
ByVal dwProcessId As
Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal
lnghProcess As Long, _
lpExitCode As
Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private RetVal As Long

Public Function ShlProc_IsRunning(ShellReturnValue As Long) As Boolean

Dim lnghProcess As Long
Dim lExitCode As Long
Dim lRet As Long

lnghProcess = OpenProcess(PROCESS_ALL_ACCESS, 0&, ShellReturnValue)
If lnghProcess < 0 Then
GetExitCodeProcess lnghProcess, lExitCode '''test if help file
is running
If lExitCode < 0 Then
ShlProc_IsRunning = True
Else
ShlProc_IsRunning = False
End If
End If

End Function

Sub ShellTester()

If ShlProc_IsRunning(RetVal) = False Then '''show help file if not
already open
On Error Resume Next
RetVal = Shell("hh.exe c:\xxx.chm", 1)
On Error GoTo 0
Else
AppActivate "Vehicle Performance Analysis"

Application.WindowState = xlMaximize

'''msgbox "Help File is already loaded"
End If

End Sub

Geoff


"JLGWhiz" wrote:

Sorry,

Application.WindowState = xlMaximize

"Geoff" wrote:

That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Taskbar and applications

there's a typo,

ActiveWindow.WindowState =xlMaximized

--


Gary


"Geoff" wrote in message
...
That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At
this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 371
Default Taskbar and applications

Ok that's got over the variable issue but its still not working. As I say
focus is switched from Excel to the app but nothing happens beyond that.

Geoff

"Gary Keramidas" wrote:

there's a typo,

ActiveWindow.WindowState =xlMaximized

--


Gary


"Geoff" wrote in message
...
That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At
this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Taskbar and applications

Geoff i am only new to this but have you tried

ActiveWindow.Visible=True

dont know if it will work but thought it might be worth a try.

"Geoff" wrote:

Ok that's got over the variable issue but its still not working. As I say
focus is switched from Excel to the app but nothing happens beyond that.

Geoff

"Gary Keramidas" wrote:

there's a typo,

ActiveWindow.WindowState =xlMaximized

--


Gary


"Geoff" wrote in message
...
That returns 'variable not defined'

Geoff

"JLGWhiz" wrote:

ActiveWindow.WindowState = xlMaximize

"Geoff" wrote:

I have created a Help file which is invoked from a cmdbutton on a userform.
If the file is minimised and the user clicks the cmdbutton again, the code
checks to see if it is already open and prevents multiple instances. At
this
stage I could also generate a message to that effect.
However i thought it would be neat to emulate a click on the taskbar icon
and make the .chm the top window again.
I have tried
AppActivate "xxx Analysis"
ActiveWindow.WindowState = vbNormalFocus
but while the file is activated it is not brought back up again.
Can someone please point the way?

T.I.A.
Geoff




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
Taskbar aftamath77 Excel Discussion (Misc queries) 0 November 21st 08 06:47 PM
sql vba applications AD108 Excel Programming 1 August 17th 06 07:28 AM
taskbar herbzee Excel Discussion (Misc queries) 2 March 20th 06 02:49 PM
Using VBA to select applications... [email protected] Excel Programming 3 October 25th 05 02:36 PM
Other applications Patrick Molloy[_4_] Excel Programming 2 July 23rd 03 12:08 AM


All times are GMT +1. The time now is 11:34 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"