Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Initialize Custom Refresh Button in Excel

Status
Not open for further replies.

penndro

Technical User
Jan 9, 2005
108
US
I am using an excel workbook that has a customized data refresh process. To refresh the workbooks contents (several sheets) you would press a "custom Refresh" button that is on the top ribbon.

If I manually press the button the procedure runs.
When I record a macro to see what the button is doing it give me the following:

Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVRefreshWorkbook"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"

So I copy that code into my macro to try and get it to run as a part of my automated process but nothing happens. Does anyone have any suggestion on how I can get this to run from with my macro (which is in the same workbook as the button)?

Any help would be appreciated,
Thanks...
 
I have updated the code to call the macro in this way

Application.Run ("Filename.xlsm!sheetname.GVaction")
Application.Run ("Filename.xlsm!sheetname.GVaction")
Application.Run ("Filename.xlsm!sheetname.GVRefreshWorkbook")
Application.Run ("Filename.xlsm!sheetname.GVaction")
Application.Run ("Filename.xlsm!sheetname.GVaction")
Application.Run ("Filename.xlsm!sheetname.GVaction")
Application.Run ("Filename.xlsm!sheetname.GVaction")
Application.Run ("Filename.xlsm!sheetname.GVaction")

Before it did not do any refresh but the complete code ran as finished. Now with the change in the code I get a runtime 1004 error message - cannot run the macro...
 
REPOST - -- Could use any help available....
I am using an excel workbook that has a customized data refresh process. To refresh the workbooks contents (several sheets) you would press a "custom Refresh" button that is on the top ribbon.

If I manually press the button the procedure runs.
When I record a macro to see what the button is doing it give me the following:

Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVRefreshWorkbook"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"
Application.Run "GVaction"

So I copy that code into my macro to try and get it to run as a part of my automated process but nothing happens. Does anyone have any suggestion on how I can get this to run from with my macro (which is in the same workbook as the button)?

The button seems to be hidden and I don't know that object name so I can't call it directly. The code above is what I get when I record the macro steps but they don't fire off...

Any help would be appreciated,
Thanks...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top