Vba to refresh

tintin1012000

Board Regular
Joined
Apr 27, 2011
Messages
237
I have a master file which is open on a remote pc it has some connections via power query and auto saves every 20min. Its always open and anyone on network can open it readonly to view data.I want to add a refresh macro so that read only user can refresh their view without closing and opening manually. Perhaps discreet close and open without updating screen.might be the way to go but i dont know how to do this using vba. Anyone think they can help
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
This is how I refresh the queries in a workbook I have. The functions called unprotects the worksheet and turns off screenupdating, events and some other stuff which is probably not interesting to you. The two lines in the middle will however refresh all queries in the workbook. You'll probably want to couple something like this with an OnTime event, which there are several threads on how to run on this forum
VBA Code:
Option Explicit

Sub Oppdater_registrering()

  Call deaktiver
  Call lås_opp_ark(Registrering)
  ThisWorkbook.RefreshAll
  Application.CalculateUntilAsyncQueriesDone
  Call lås_ark(Registrering)
  Call reaktiver
End Sub
 
Upvote 0

Forum statistics

Threads
1,212,938
Messages
6,110,782
Members
448,297
Latest member
carmadgar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top