这是受公式可以引用不打开文件数据启发而来的代码:

Sub GetClosedFileValues()
Dim strFN As String
strFN = ThisWorkbook.Path & "\[Test.xlsx]"
With Worksheets("Sheet1").Range("A1:M50")
.FormulaR1C1 = "='" & strFN & "Sheet1'!rc"
.Value = .Value
End WithEnd
Sub
把想要引用数据的单元格用 FormulaR1C1 的方式写成公式,再把公式转为单元格值。