ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro does not run when data refreshed (https://www.excelbanter.com/excel-discussion-misc-queries/3950-macro-does-not-run-when-data-refreshed.html)

Larry Lehman

Macro does not run when data refreshed
 
I set up a worksheet at work that queries our lab
information system for incomplete high priority orders.
The results of the query are display in order by age,
oldest to newest. The Data Range Properties is set to
refresh the data every 2 minutes and overwrite existing
cells with new data and clear unused cells.

After new data is imported there is a Visual Basic macro
that compares the time of each order to the current PC
time and changes the color of the text from green to
yellow to red as the order ages. All of the works great.

I've recently duplicated this worksheet at a second
hospital lab and at that site the query works fine and the
macro works as expected when it's run manually. However
the macro does not run automatically when the data is
refreshed.

The only difference I can find between the two worksheets
is on File-Properties-Contents. The worksheet that works
as expected (macro runs whenever data is refreshed) shows
the Contents as:
Worksheets
Sheet1
Named Range
Query from MSQLLAB
The worksheet that does not run the macro when the data is
updated does not have the Named range.

What is causing the second worksheet not to recognize the
refresh of the data as a change in the worksheet? Both
worksheet have security set to low and niether PC is run
virus protection software.

Any help would be greatly appreciated.

Thanks,



All times are GMT +1. The time now is 10:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com