Private Function Getvalue(path, file, sheet, ref) Dim Arg As String Arg = "'" & path & "[" & file & "]" & sheet & "'!" & Range(ref).Range("A1").Address(, , xlR1C1) Getvalue = ExecuteExcel4Macro(Arg)End Function