ich möchte in Mappe1/Tabelle1 den aktuellen Wert von der anderen Exceldatei Mappe2 Feld a2. Erhalte aber immer eine Fehlermeldung.
Hat jemand eine Idee, Danke 1000 mal
ActiveCell.Offset(0, 0).Value = Windows("Mappe2").Sheets("Tabelle1").Range("a2")
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