Gruppe
Funktion
Problem
Wie kann ich über VBA auf eine geschlossene Arbeitsmappe zugreifen?
StandardModule: basMain
Sub Zugriff()
Dim sPath As String, sFile As String
Dim sWks As String, sRng As String
sPath = ThisWorkbook.Path & "\"
sFile = Range("B1").Value
sWks = Range("B2").Value & "'!"
sRng = Range("B3").Value
If Dir(sPath & sFile) = "" Then
Beep
MsgBox prompt:="Arbeitsmappe '" & _
sPath & sFile & "' wurde nicht gefunden!"
Exit Sub
End If
With Range("IV1")
.Formula = "='" & sPath & "[" & sFile & "]" & sWks & sRng
MsgBox prompt:=.Value
.ClearContents
End With
End Sub