View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default AutoRun Excel Macros

I set up msquery to update every minute from an Access database and this
fired the change event. It is unclear what is updating every second - the
MS SQL database or Excel. If it is Excel, then you could use the change
event as Ron has pointed out. I doubt you need to print something every
second, particularly if you are updating from 3 different databases, but
perhaps you can cobble something together from the change event.
(retrieving data and printing a report would probably take longer than a
second, so you might have to lengthen you time between queries. )

for an overview of Events, see Chip Pearson's site:

http://www.cpeason.com/excel/events.htm

--
Regards,
Tom Ogilvy

"JD" wrote in message
...
Tom,
Thanks for the reply. The value is updated every second using the built

in
database query tools. The database is MS SQL - if that has any bearing.
Basically this discrete value is originates in a controller for a

production
line and should drive a macro that pulls in data from three different
databases and then prints a report. All automatic - thus the dilemma.

The
macro and database connectivity all works and I can manually run the macro

to
generate the report and print - just need this last piece. Any ideas?

"Tom Ogilvy" wrote:

How is the value going to change?

If by editing manually, can we assume that if the cell is edited, the

macro
should run. (if it had a value of 2 and it still had a value of 2 after
editing, should the macro run?).

--
Regards,
Tom Ogilvy

"JD" wrote in message
...
Is there any way to automatically run a macro in excel based on the

value
of
a cell in that workbook? i.e. the value changes from 0 to 1 = run

macro.
Anyone have a copy of code that does this? Using VBA and don't have

full
blown VB - thanks!!!!