Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Automating Refreshing Part (III)

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, Procedu=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, Procedu=CRunWhat, Schedule:=True

End Sub

Jessica
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Part of the screen has blank spots (not refreshing properly) [email protected] New Users to Excel 3 January 31st 12 08:00 PM
Part of the screen has blank spots (not refreshing properly) Victor Delta[_2_] Excel Discussion (Misc queries) 1 January 25th 12 11:47 AM
Search/Match/Find ANY part of string to ANY part of Cell Value TWhizTom Excel Worksheet Functions 0 July 21st 08 08:16 PM
Automating Refreshing (Part II) Jessica Excel Programming 13 August 17th 07 07:40 PM
How can I sperate the module into two part and connecte the two part and work well? ¬f©÷ Excel Programming 1 November 7th 04 03:05 AM


All times are GMT +1. The time now is 01:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"