View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.links
clara via OfficeKB.com clara via OfficeKB.com is offline
external usenet poster
 
Posts: 1
Default Automatic Function Result Update when using A VLOOKUP on another F

Hi,

it works fine but could it be possible to bypass the password if I've set in
file B?

Thanks in advance,
Clara

Bill Manville wrote:
The only way you will get file B to contain up to date data is to open
it. You could have file A open and close file B on startup.

Sub RefreshFromFileB()
Dim WS As Worksheet
Dim QT As QueryTable
Application.ScreenUpdating = False
Workbooks.Open ThisWorkbook.Path &"\FileB.xls"
For Each WS In ActiveWorkbook.Worksheets
For Each QT In WS.QueryTables
QT.Refresh BackgroundQuery:=False
Next
Next
ActiveWorkbook.Save
ActiveWorkbook.Close False
Application.ScreenUpdating = True
End Sub

Sub Auto_Open()
' update from FileB when I've finished opening.
Application.OnTime Now,"RefreshFromFileB"
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...links/200608/1