on-internet
← Community

How to get the cell value from a linked worksheet

Stack Overflow ·

Don't seem to be able to read a value from a cell in a linked (closed) worksheet. The code below just seems to stop before reaching the MsgBox "test 2" test line with no error displayed. The return from the function is then always #VALUE Private Function GetCellTest() As Variant CellPath = "'C:\...\[Nov.xlsx]Sheet1'!A1" MsgBox "test 1" CellPathValue = CellPath.Value MsgBox "test 2" GetCellTest = CellPathValue End Function

Comments

Sign in or sign up to comment and upvote.

No comments yet.