Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Running SQL Querry after every 10 minutes.

Hi All

I have one SQL Querry which I run in background using following code in VBA
macro.

With Selection.QueryTable
.Connection = "ODBC;DSN=MTRAC;UID=mtuser;PWD=mtuser;SERVER=MTUSE R;"
.Refresh BackgroundQuery:=False
End With

This works fine when I run the VBA macro. But I want to run this query in
every 10 minutes for continuous monitoring of the data. I have one standalone
PC for this application where this excel workbook is open all the time. I
know I can use windows scheduler to open this workbook and run the query when
workbook opens. But I am just wondering if there is any other way to do this.

Your help would be greatly appreciated.

Kind Regards
Harish

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Running SQL Querry after every 10 minutes.


Harish wrote:
Hi All

I have one SQL Querry which I run in background using following code in VBA
macro.

With Selection.QueryTable
.Connection = "ODBC;DSN=MTRAC;UID=mtuser;PWD=mtuser;SERVER=MTUSE R;"
.Refresh BackgroundQuery:=False
End With

This works fine when I run the VBA macro. But I want to run this query in
every 10 minutes for continuous monitoring of the data. I have one standalone
PC for this application where this excel workbook is open all the time. I
know I can use windows scheduler to open this workbook and run the query when
workbook opens. But I am just wondering if there is any other way to do this.

Your help would be greatly appreciated.


Take a look at Application.OnTime in VBA...

Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Running SQL Querry after every 10 minutes.


"Mike Woodhouse" wrote:


Harish wrote:
Hi All

I have one SQL Querry which I run in background using following code in VBA
macro.

With Selection.QueryTable
.Connection = "ODBC;DSN=MTRAC;UID=mtuser;PWD=mtuser;SERVER=MTUSE R;"
.Refresh BackgroundQuery:=False
End With

This works fine when I run the VBA macro. But I want to run this query in
every 10 minutes for continuous monitoring of the data. I have one standalone
PC for this application where this excel workbook is open all the time. I
know I can use windows scheduler to open this workbook and run the query when
workbook opens. But I am just wondering if there is any other way to do this.

Your help would be greatly appreciated.


Take a look at Application.OnTime in VBA...

Mike


Thanks for your reply.I have used this function but it is quite lenghty
code.As for I have to refresh in every 10 minutes.So for 24 hours I need to
write 144 lines of code.
Is there any other way to do this?

Kind Regards
Harish

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
Deducting minutes off running total Sid Excel Discussion (Misc queries) 2 December 7th 09 02:39 PM
querry Eva Excel Discussion (Misc queries) 4 August 21st 07 11:42 PM
Use two different value to run a querry Arnaud Excel Discussion (Misc queries) 0 March 9th 07 10:28 AM
Database Querry Joshua Campbell[_2_] Excel Programming 8 April 12th 05 07:02 PM
Querry Range and Add Sandy Excel Programming 0 March 8th 05 07:41 PM


All times are GMT +1. The time now is 06:56 AM.

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"