PC Review


Reply
Thread Tools Rate Thread

Automating Refreshing Part (III)

 
 
=?Utf-8?B?SmVzc2ljYQ==?=
Guest
Posts: n/a
 
      17th Aug 2007
Good afternoon,

I do apologize for the later reply, but I just came to work. :-)

While I was test running the langauge, again, the password box is fine, yes.
It is when it is trying to call the timer to start that it doesn't actually
start.

To clarify, when the spreadsheet opens, it never refreshes, even with the
togglebutton1 value being true. Now when I push the button it does ask for
the password and I'd assume it stops the timer since the button action is
false. When I repush the button to start the refresh, it doesn't start the
timer and I haven't figured out what is needed to start the timer from the
code that is there.

I wish I could email you the example, but our email is heavily restricted to
only people inside the company (I am not IT persay, I'm a floor person doing
this work as requested).

Any help is definately appreciated. :-)

This is the code that currently works (asks for password):

Public RunWhen As Double
Public Const cRunIntervalSeconds = 60 ' Thirty minutes
Public Const CRunWhat = "Refresher" ' name of procedure to run

Private Sub ToggleButton1_Click()

Dim x As String, pword As String
pword = "test"
x = InputBoxDK("Type your password here.", "Password Required", "")


If x = pword Then
'Change caption on Toggle button
ToggleButton1.Value = False
ToggleButton1.Caption = "Refresh Disabled"

'Stop Timer from running again

StopTimer
Else
'Change caption on Toggle button
ToggleButton1.Value = True
ToggleButton1.Caption = "Refresh Enabled"

'Call StartTimer Sub to begin refreshing
StartTimer

' Notify User
MsgBox "You didn't enter the correct password to turn off the
refresher."
End If

End Sub


Sub StopTimer()

On Error Resume Next
Application.OnTime EarliestTime:=RunWhen, Procedure:=CRunWhat, Schedule:=False

End Sub
Sub Refresher()
'Makes the entire Workbook Refresh

ThisWorkbook.RefreshAll

StartTimer
End Sub


Sub StartTimer()

RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime EarliestTime:=RunWhen, Procedure:=CRunWhat, Schedule:=True

End Sub

Jessica
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Medical CDs - [Part 2], [Part 1], [Part 3 = MEDLINE 1986-1998] CDs ola Windows XP Basics 0 18th Aug 2007 08:19 AM
Automating Refreshing (Part II) =?Utf-8?B?SmVzc2ljYQ==?= Microsoft Excel Programming 13 17th Aug 2007 07:40 PM
text/plain part of multipart message ignored; html part converted instead (Outlook 2003) kiden Microsoft Outlook Discussion 3 23rd Oct 2006 12:11 PM
Automating SendMail() part II Nuyttens Xavier Microsoft Word Document Management 0 16th Jun 2005 07:20 AM
The quick launch part icon keeps refreshing every second, it never does this before Long Microsoft Windows 2000 1 30th Jun 2004 06:00 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:40 PM.