Hi everybody,

I'm facing a problem in updating data in two separate workbook can
anyone help me in this ?

I have 2 excel files one is Master file and other is the snapshot
file. All the working are done in the master file and in the snapshot
file all the different scenarios are show, in which values are to be
entered.

Now the problem being faced by me is that at any given point only the
snapshot file will be open and the values would be entered into this
file only, whereas the calculation are to be done in the master file.
Since the master file is not open the values are not updated and the
result of that particular inputs in the snapshot sheet is not
available.

The snapshot sheet updates only when i open the master file along the
snapshot file.

Can any one help me writing a macro which would update the closed
master file and also reflect the results in the snapshot file.

I have used the following macro but its somehow not working since the
masterfile is different folder.

Sub UpdateSelectedLinks()
Dim aLinks
Dim cLink As String
Dim i As Integer
Application.ScreenUpdating = False
aLinks = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(aLinks) Then
For i = 1 To UBound(aLinks)
cLink = Split(aLinks(i), "\")(UBound(Split(aLinks(i), "\")))
If cLink <> "book1.xls" Then
Workbooks.Open aLinks(i)
Workbooks(cLink).Close SaveChanges:=False
End If
Next i
End If
Application.ScreenUpdating = True
End Sub


Please help me in solving this problem.

Thanks in advance.


Abhishek Pradhan
-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Reply via email to