I apologize if I came off as short or if my answer was not a valid solution, I can assure you that I was just trying to help. After further reviewing your initial question you are correct. I misread your post regarding the testing of the qualified reference. This is certainly a mistake on my part. I can see that you tested the values properly. It is my understanding that VBA does not contain a native method to read values from another workbook, but it looks like there is a caveat to this, which can be taken advantage of by using Legacy Excel 4.0 (1992) functionality. As you have referenced you can read values from a closed workbook if an absolute path is referenced. This being said, I believe you have at least two feasible options (there may be more).
1. Use a worksheet to hold a temporary calculation
a. Insert a fully qualified path formula in a cell via VBA code.
b. Read the value from the cell
c. Remove the value
Sub Test()
'Pass value to range
Range("A1") = "='C:\Users\mmickle1\Documents\[Test1.xlsm]Fun&Games'!SoF"
'This also seems to work in my test ---> Range("A1") = "='[Test1.xlsm]Fun&Games'!SoF"
'Pass value to variable
MyVar = Range("A1")
'Clear Range
Range("A1") = vbNullString
End Sub
2. Use John Walkenbach's UDF which takes advantage of ExecuteExcel4Macro (Legacy Excel 4.0 XLM Macro)
Caveat: I tested this and it doesn't seem to allow for Named Ranges. It appears it will only take a value like A1. However, if the workbook is open it will accept a Named Range.
Private Function GetValue(path, file, sheet, ref)
' Retrieves a value from a closed workbook
Dim arg As String
' Make sure the file exists
If Right(path, 1) <> "\" Then path = path & "\"
If Dir(path & file) = "" Then
GetValue = "File Not Found"
Exit Function
End If
' Create the argument
arg = "'" & path & "[" & file & "]" & sheet & "'!" & _
Range(ref).Range("A1").Address(, , xlR1C1)
' Execute an XLM macro
GetValue = ExecuteExcel4Macro(arg)
End Function
Sub TestGetValue()
p = "C:\Users\mmickle1\Documents"
f = "Test1.xlsm"
s = "Fun&Games"
a = "A1"
MsgBox GetValue(p, f, s, a)
End Sub
Regarding using your real name on the forums. I did not realize this was a new requirement. I typically use a handle (mrmmickle1) as you referenced was your preference. I answer questions on many different forums and this requirement did not stand out to me. I can definitely understand why using your name is not appealing and how posting under a username would be preferable for greater privacy. You certainly make a good point. Thanks for the refreshing point of view.
I hope my answer will help solve your inquiry. My aim is only to help you resolve your issue. Please let me know if these options do not work for your particular situation. I'm happy to look into the issue further if these solutions aren't valid for your workbook.