• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copy Updated Data from Closed workbook to Open workbook

alexnkc

New Member
Hi,

I will like to copy data from closed workbook (bbb.xls) to Open workbook (aaa.xls) without opening bbb.xls.
Code below work find for that.

Code:
Sub GetDataFrombbb()

With Range("F4")
.Formula = "='" & ThisWorkbook.Path & "\[bbb.xls]Sheet1'!$N$11"
.Value = Range("f4").Value
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Borders.LineStyle = xlContinuous
.Borders.Weight = xlThin
End With

End Sub

How to upgrade the code above to enable it to copy updated data from closed workbook (such as usingformula that give row count from N and use that to copy the formula down)
Please help as I am no able to write out the VBA langauge.

Thanks in advance
 
Hi SirJB7,
Actually I try to get the work done by not using wb.open adn wb.close. Is there any other to do it?
 
Hi, alexnkc!
Checked Harlan Grove's method? It's the classic workaround.
And no, I insist, there's no way to know what's at the other side of a closed door if you don't open it or someone does it for you. With closed workbooks and files in general it's the same. Maybe at Harry Potter's forums you might be more lucky... but beware with the 9 3/4 platform, bricks are hard.
Regards!
 
Back
Top