Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Taskbar | Excel Discussion (Misc queries) | |||
sql vba applications | Excel Programming | |||
taskbar | Excel Discussion (Misc queries) | |||
Using VBA to select applications... | Excel Programming | |||
Other applications | Excel Programming |