Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub Workbook_BeforeClose(CANCEL As Boolean)
Dim cTime As Long Dim WSH As Object Set WSH = CreateObject("WScript.Shell") cTime = 1 ' 1 secs Select Case WSH.Popup("Last Updated By" & Application.UserName, cTime "Closing", vbOKOnly) End Select Call macro1 End Sub this pops up a box that says last updated by & username, then goes awa after 1 second. the only thing that i would change about it, is tha it has an 'okay' button on it. is it possible to have no buttons -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could do this more simply with a UserForm - design one
with a TextBox (here called TextBox1) and set the ShowModal Property to False; then you can use this code: Private Sub Workbook_BeforeClose(CANCEL As Boolean) Dim StartTime As Date UserForm1.TextBox1.Value = "Last Updated By " & Application.UserName StartTime = Now UserForm1.Show While StartTime (Now - TimeValue("00:00:10")) DoEvents Wend UserForm1.Hide End Sub -----Original Message----- Private Sub Workbook_BeforeClose(CANCEL As Boolean) Dim cTime As Long Dim WSH As Object Set WSH = CreateObject("WScript.Shell") cTime = 1 ' 1 secs Select Case WSH.Popup("Last Updated By" & Application.UserName, cTime, "Closing", vbOKOnly) End Select Call macro1 End Sub this pops up a box that says last updated by & username, then goes away after 1 second. the only thing that i would change about it, is that it has an 'okay' button on it. is it possible to have no buttons? --- Message posted from http://www.ExcelForum.com/ . |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks,
that works good, however, it doesn't seem to go away on it's own. changed the 00:00:10 to 00:00:01 and it didn't ever get to th userform.hide any suggestions -- Message posted from http://www.ExcelForum.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't know why it isn't getting to UserForm.Hide. Are you
sure you have the While loop set up properly, with a DoEvents inside it? And that the UserForm's Modal property is False? Those would be the most likely things to cause problems. The code I sent worked on my machine as written - was a cut and paste; I am using Excel 2000. -----Original Message----- Thanks, that works good, however, it doesn't seem to go away on it's own. i changed the 00:00:10 to 00:00:01 and it didn't ever get to the userform.hide any suggestions? --- Message posted from http://www.ExcelForum.com/ . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i'm on XP professional. here is the code in question:
Public Sub UserFormClose() Dim StartTime As Date UserForm3.Label1.Caption = "Last Updated By " & Application.UserName StartTime = Now UserForm3.Show While StartTime (Now - TimeValue("00:00:01")) DoEvents Wend UserForm3.Hide End Sub still not getting to the hide line. thanks. --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Option Buttons/Radio Buttons | New Users to Excel | |||
Form buttons vs. ActiveX Buttons | Excel Discussion (Misc queries) | |||
have toggle buttons but everytime print preview buttons move | Excel Discussion (Misc queries) | |||
pivot chart is it possible to hide individual field buttons? Layout Field buttons | Charts and Charting in Excel | |||
Control Buttons vs. Command Buttons | Excel Programming |