Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Links / September 2006

Tip: Looking for answers? Try searching our database.

Automatic Function Result Update when using A VLOOKUP on another F

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Quicky - 17 Aug 2006 09:53 GMT
Hi all,

I have an excel file A that use a VLOOKUP to retrieve data from another
Excel file B.
The data retrieved in B file is computed with diffrerent funtions that get
data from a database.

When I open file A, the data from B is retrieved BUT the functions into B
are not recomputed so I retrieve out of data data.

Does someone know how to do in order that I get data from file B updated
when I open the file A.

I do not want to ask the users to first go in file B to update data and then
open file A.

Thank you for your help,
Signature

Quicky

Bill Manville - 18 Aug 2006 00:36 GMT
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
clara - 23 Aug 2006 07:14 GMT
Hi,

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

Thanks in advance,
Clara

>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.
[quoted text clipped - 22 lines]
>MVP - Microsoft Excel, Oxford, England
>No email replies please - respond to newsgroup
Bill Manville - 23 Sep 2006 17:22 GMT
Clara via OfficeKB.com wrote:
> it works fine but could it be possible to bypass the password if I've set in
> file B?

Sorry for late reply.
Sure - you can specify a password with Workbooks.Open:
Workbooks.Open ThisWorkbook.Path &"\FileB.xls", Password:="MyPassword"

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.