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
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

eirikdaude

Board Regular
Joined
Nov 26, 2013
Messages
60
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
 

Watch MrExcel Video

Forum statistics

Threads
1,127,395
Messages
5,624,487
Members
416,031
Latest member
Omega67

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
Top