
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VBScript: AppActivate / Restore Window not working
Hi All,
I'm trying to restore a window that has been minimised but I can't get the VBScript working?
This should work:
sub restore
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate "Untitled - Notepad"
success = WshShell.appactivate("Untitled - Notepad")
if success then WshShell.sendkeys "% r"
end sub
Any ideas, to where I've gone wrong?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jammy,
Try this,
Sub restore
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "Untitled - Notepad"
success = WshShell.appactivate("Untitled - Notepad")
if success then WshShell.sendkeys "% r"
End Sub

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tried but unfortunately it still doesn't restore the minimised program?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
rem **Can you try this**
set c=ActiveDocument.GetSheetObject("YourObjectID")
if c.IsMaximized then
c.Restore
else
c.Maximize
end if

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This didn't work either

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you show a screenshot of what kind of object you want to minimize ?
If trying to restore objects when navigating from one sheet to other.....This would make all minimized object to maximize in active sheet object, if any...
Sub maxi
set s = ActiveDocument.ActiveSheet.SheetObjects(0).GetSheet
for i=0 to s.NoOfSheetObjects-1
s.SheetObjects(i).restore
next
end sub

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After a macro is run, for some reason Qlikview gets confused & brings the last active window to the front.
For example... I open a QV file from explorer -> run the macro in QV -> explorer is brought to the font.
If explorer is minimised, this doesn't happen. So I need a script which restores QV to the front.
I have this working:
Sub open
dim objSHL
set objSHL = createobject("wscript.shell")
objSHL.AppActivate "Notepad"
objSHL.sendkeys "(% )(R)"
End Sub
So this will restore Notepad to the front.
But now the next question..... how to restore the current QV project to the front?
I've substituted "Notepad" with... "QliKView", "QlikView x64........ " all combinations but it doesn't restore QV to the front!?
Any more ideas, as it's driving me crazy?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my experience it should be last way to solve a task with activating/restoring windows and sending shortcuts per any script - it won't never run really stable. Therefore what is your real aim? Maybe there are other ways to get your wanted results.
- Marcus
