ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically start a macro after data refresh (https://www.excelbanter.com/excel-programming/440740-automatically-start-macro-after-data-refresh.html)

Kurt Barr

Automatically start a macro after data refresh
 
I've set up a few data connects and I want to start up a macro each time
after I've refreshed those connections. I only want the macro to run when I
refresh the query and I only want to refresh manually.

Is there a command to do that?

B Lynn B

Automatically start a macro after data refresh
 
Why not just write a macro to perform the manual refresh, then call whatever
other procedure you want to run? i.e.

Range("a1").ListObject.QueryTable.Refresh
call mySub

"Kurt Barr" wrote:

I've set up a few data connects and I want to start up a macro each time
after I've refreshed those connections. I only want the macro to run when I
refresh the query and I only want to refresh manually.

Is there a command to do that?


Kurt Barr

Automatically start a macro after data refresh
 
Good point. I hadn't even thought about it that way. I guess taking the steps
to kick off a macro versus the refresh is about the same.

Thanks!

"B Lynn B" wrote:

Why not just write a macro to perform the manual refresh, then call whatever
other procedure you want to run? i.e.

Range("a1").ListObject.QueryTable.Refresh
call mySub

"Kurt Barr" wrote:

I've set up a few data connects and I want to start up a macro each time
after I've refreshed those connections. I only want the macro to run when I
refresh the query and I only want to refresh manually.

Is there a command to do that?



All times are GMT +1. The time now is 03:15 AM.

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