Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default OnTime Unusual Application

I run a spread sheet with DDE links that are updating continuously,
every 1-3 secs and more often I need to monitor a given criterea and
sample the data every 15 mins if the condition is valid then copy the
data to another sheet.

The OnTime function seems to fit this criterea to run the copy and
paste function, but I can not get the syntax to call the Copy Sub at
the designated times.

This will run 72 calls per day, in theory but how do you set out the
relationship of OnTime syntax and the Subroutine.

Any help appreciated... does anyone have experience of OnTime and DDE
as in relation to if it stops the DDE function as I have tested
Application.Wait functions but this stops the DDE link until it times
out.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default OnTime Unusual Application

Ontime is pretty straightforward. Check out
http://www.cpearson.com/excel/ontime.htm, and post your code if you still
have problems.

--
HTH

-------

Bob Phillips
"Peter" wrote in message
oups.com...
I run a spread sheet with DDE links that are updating continuously,
every 1-3 secs and more often I need to monitor a given criterea and
sample the data every 15 mins if the condition is valid then copy the
data to another sheet.

The OnTime function seems to fit this criterea to run the copy and
paste function, but I can not get the syntax to call the Copy Sub at
the designated times.

This will run 72 calls per day, in theory but how do you set out the
relationship of OnTime syntax and the Subroutine.

Any help appreciated... does anyone have experience of OnTime and DDE
as in relation to if it stops the DDE function as I have tested
Application.Wait functions but this stops the DDE link until it times
out.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default OnTime Unusual Application

and to add, Ontime does not stop DDE during the "wait" period like Wait
does.

--
Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
Ontime is pretty straightforward. Check out
http://www.cpearson.com/excel/ontime.htm, and post your code if you still
have problems.

--
HTH

-------

Bob Phillips
"Peter" wrote in message
oups.com...
I run a spread sheet with DDE links that are updating continuously,
every 1-3 secs and more often I need to monitor a given criterea and
sample the data every 15 mins if the condition is valid then copy the
data to another sheet.

The OnTime function seems to fit this criterea to run the copy and
paste function, but I can not get the syntax to call the Copy Sub at
the designated times.

This will run 72 calls per day, in theory but how do you set out the
relationship of OnTime syntax and the Subroutine.

Any help appreciated... does anyone have experience of OnTime and DDE
as in relation to if it stops the DDE function as I have tested
Application.Wait functions but this stops the DDE link until it times
out.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default OnTime Unusual Application


Bob Phillips wrote:
Ontime is pretty straightforward. Check out
http://www.cpearson.com/excel/ontime.htm, and post your code if you

still
have problems.

--
HTH

-------

Bob Phillips
"Peter" wrote in message
oups.com...
I run a spread sheet with DDE links that are updating continuously,
every 1-3 secs and more often I need to monitor a given criterea

and
sample the data every 15 mins if the condition is valid then copy

the
data to another sheet.

The OnTime function seems to fit this criterea to run the copy and
paste function, but I can not get the syntax to call the Copy Sub

at
the designated times.

This will run 72 calls per day, in theory but how do you set out

the
relationship of OnTime syntax and the Subroutine.

Any help appreciated... does anyone have experience of OnTime and

DDE
as in relation to if it stops the DDE function as I have tested
Application.Wait functions but this stops the DDE link until it

times
out.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default OnTime Unusual Application


Bob Phillips wrote:
Ontime is pretty straightforward. Check out
http://www.cpearson.com/excel/ontime.htm, and post your code if you

still
have problems.

--
HTH

-------

Bob Phillips
"Peter" wrote in message
oups.com...
I run a spread sheet with DDE links that are updating continuously,
every 1-3 secs and more often I need to monitor a given criterea

and
sample the data every 15 mins if the condition is valid then copy

the
data to another sheet.

The OnTime function seems to fit this criterea to run the copy and
paste function, but I can not get the syntax to call the Copy Sub

at
the designated times.

This will run 72 calls per day, in theory but how do you set out

the
relationship of OnTime syntax and the Subroutine.

Any help appreciated... does anyone have experience of OnTime and

DDE
as in relation to if it stops the DDE function as I have tested
Application.Wait functions but this stops the DDE link until it

times
out.



Thanks Bob,

I have the Timer running and it functions with DDE the only problem is
is runs 2 Tx for each call I have tried several ideas and I can not see
why it runs 2 tx.

I will attach the code there might be some thing obvious I am
missing....

Public RunWhen As Double
Public Const cRunIntervalSeconds = 90 '15 Minutes
Public Const cRunWhat = "LOGGER"

Sub Timer()
' Keyboard Shortcut: Ctrl+Shift+Z
'MsgBox "Timer Called"
RunWhen = Now() + TimeSerial(0, 0, cRunIntervalSeconds)
Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, _
schedule:=True
'MsgBox "Timer Ran"
End Sub

Sub LOGGER()
' LOGG Macro
' Keyboard Shortcut: Ctrl+Shift+L
Sheets("Log").Select
Dim emptyRow
If Sheets("LOG").Range("A1").Value = True Then
'Data
'Calculate the row number of the first free cell in our logging sheet
emptyRow = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Sheets("MR Count").Range("A3:BH3").Copy
Sheets("Log").Select
Cells(emptyRow, 2).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
'Time
'The line below logs the time of the entry in the log in column A
Cells(emptyRow, 1).Value = Now()
End If
Sheets("Log").Select
Range("B1").Select
End If
'Resets Timer for next logg in 15 mins
Timer
End Sub



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
Application.ontime from shared drive jlclyde Excel Discussion (Misc queries) 3 August 20th 09 09:42 PM
Application.OnTime driving me crazy Tom Ogilvy Excel Programming 12 November 1st 04 02:42 PM
Application.OnTime driving me crazy Lars-Åke Aspelin Excel Programming 0 October 31st 04 12:24 AM
Application.OnTIme Mike Excel Programming 8 September 15th 04 03:27 PM
Application.OnTime and Visual C++ cdupain Excel Programming 0 November 12th 03 10:11 AM


All times are GMT +1. The time now is 02:21 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"