Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pop up windows using excel

Status
Not open for further replies.

excellover

Technical User
Nov 15, 2002
10
0
0
CA
I want to pop up a window at a fixed time using excel to remind me of doing sth.
My problem is that I can pop up a window, but I can not let the window show on the top of other windows, eg. IE, so that I could notice the reminder.
I tried win32api functions : bringwindowsTotop(),meesagebox(),still I can not get what I want, that is, pop up a window that can sit on top of other windows.
thanks
 
response = MsgBox("hi", vbSystemModal)

Provides an OK only msgbox that has to be clicked before anything else is done on the system.
 
excellover,

Have you considered using Outlook's "Calendar" ?

By setting up "Appointments" using the "Recurrance" and "Reminder" options, you could have a message set to "pop up" on your screen at a set time every day, or every workday, and for whatever number of days you specify.

It would seem this option has the potential to achieve your objective.

Hope this helps :) Please advise as to whether this is a workable option.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
guys, your answer is greatly appeciated.
My code is like:

Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

Sub StartCallBack()
Application.OnTime TimeValue("10:25:20"), "RemindMe"
End Sub
Sub RemindMe()
MessageBox 0&, "Reminder", "Boss comming",1
End Sub

First I run StartCallBack(), then I surf internet,However, boss is coming at 10:30, so I want Excel pop up a window sitting on top of the browser window,so I know time to stop surfing.

What I got is a window showing up only when I switch to Excel window, which is not much useful.

I have not touched Outlook till now, and I am excellover, so I want to stick to excel

thanks



 
The system modal box doesn't seem to have the desired effect. It doesn't go on top when it first appears, and when Excel is reactivated, it goes on top (and stays on top when navigating to other apps) but doesn't have the "modal" effect of preventing other interactions until the box is cleared. This is in Excel 2000 on Win2000.
Rob
[flowerface]
 
From the helpfile:

vbSystemModal
$096
System modal; all applications are suspended until the user responds to the message box.

And yet it appears you're right about it just not working. Excel flashed on the task bar but until you actually switch to Excel, the button doesn't come up. And then just stays on top without stopping you doing anything. (Seemed to work when I first tried it, honest.)
You could get it to beep?
Or be really flash and call the wav playing API with a sirens wav or something.
Use:

Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

in your declarations and then

sndPlaySound "C:\WINDOWS\MEDIA\Logoff.wav", SND_SYNC


And I have tested this and it works.
 
Or you could use a variation of this:

Sub tester()
Application.OnTime Now + TimeValue("00:00:05"), "herein"

End Sub
Sub herein()
whatever = Shell("C:\Program Files\Microsoft Office\Office\Excel.exe", 1)
End Sub

Unfortunately, it just opens a new instance of Excel. But it'll certainly warn you. Or make a simple VB6 proggie that just warns you and then closes on click. Point it to that.
 
I continued my research on this,
I tried emnuwindows() win32api followed by bringtotopwindow(), I saw all windows show up and gone, but still not what I want
thank you guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top