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

On 30 Oct 2004 21:26:22 GMT, Ron
wrote:

Hello vba gurus [green with envy, but learning]


I have a web query that needs refreshing periodically throughout the
day. Sometimes upto 20 times.
The web query URL is mostly static but has a 7 digit event number tagged
on the end.

i.e. http://webquery-site/market.asp?id=2211993

The url is static but the 7 digit number on the end changes every day,
and also several times through the day.

Ordinarily I do this manually but am going away for 2 weeks and want to
automate this so a friend can set it running on a morning and let it do
it's thing all day.

I have in column F a list of times ie 20:28:00 and in column H I have
the corresponding event id's ie 2211993, 2211994, 2211897 etc.

What I'm struggling with is getting the Application.OnTime procedure to
work correctly.

My code at the moment is..

Sub OnTimeTest()
Dim TimeCell2 As String
TimeCell2 = Sheets("test").Range("F2")
Application.OnTime TimeValue("TimeCell2"), "testProcedure"
End Sub


The variable TimeCell2 is the time that sits in cell F2.

The procedure "testProcedure" simply pops up a message box for now until
I get this right then I will link it to the sub that refreshes the
query.

I'm sure the solution is something simple but I'm at a loss now. I
think I'm going wrong on the syntax somewhere.

Any ideas guys?

Thanks

Ron


Hi Ron,

Try this:

Replace the "TimeCell2" argument to TimeValue with

Format(TimeCell2, "hh:mm:ss")

Hope this helps

Lars-Åke
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
Driving me CRAZY~ please help Tara New Users to Excel 0 July 7th 08 07:29 PM
Sorry for reposting - but this is driving me crazy! Bean123r Excel Discussion (Misc queries) 1 January 27th 06 02:31 PM
VLOOKUP driving me crazy LB79 Excel Discussion (Misc queries) 5 December 13th 05 04:14 PM
HELP!? Passwords are driving me crazy. NoviceJESS Excel Worksheet Functions 6 January 21st 05 06:02 AM
Driving me crazy! Dick Kusleika[_3_] Excel Programming 0 October 21st 03 10:18 PM


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