Hi All,
Let's say I have 2 xls file (test1.xls & test2.xls); and test1 file referring the value from test2 file
TEST 1.xls
To do the above actions, I created a macro, but excel always frozen for couple of seconds during cell value set (.Cells(X, Y).FormulaR1C1 = tempvalue); as it will check the value from test2.xls
I've tried to unlink the file beforehand:
as well as
and
But no luck, it seems XLS keeps linking to that page everytime I put value (either manually / by macro)
Any idea?, as it slows down my xls
Thanks
Let's say I have 2 xls file (test1.xls & test2.xls); and test1 file referring the value from test2 file
TEST 1.xls
Code:
Cell (A1) => "Test"
Cell (A2) => formula:
=HLOOKUP(A1,'c:\[test2.xls]sheet1'!$H$2:$CF$125,124,FALSE)
Cell (B1) => "Blah"
Cell (B2) => formula:
=HLOOKUP(B1,'c:\[test2.xls]sheet1'!$H$2:$CF$125,124,FALSE)
Cell (C1) => "Blah again"
Cell (C2) => formula:
=HLOOKUP(C1,'c:\[test2.xls]sheet1'!$H$2:$CF$125,124,FALSE)
Code:
With Sheets("TEST2")
Y = 2
Do While (.Cells(X - 1, Y).Value <> "")
tempvalue = "=HLOOKUP(R[-1]C,'C:\[TEST2.xls]Sheet1'!R2C8:R125C84,124,FALSE"
[B].Cells(X, Y).FormulaR1C1 = tempvalue[/B]
Y = Y + 1
Loop
end with
Code:
astrLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
If Not IsEmpty(astrLinks) Then
ActiveWorkbook.BreakLink _
Name:=astrLinks(1), _
Type:=xlLinkTypeExcelLinks
End If
Code:
Application.ScreenUpdating = false
Code:
Application.Calculation = xlCalculationManual
Any idea?, as it slows down my xls
Thanks
Last edited: