Code zum Prüfen, ob Datei geöffnet ist
23.09.2004 15:19:08
Paul
bei folgendem Code steckt ein Fehler bei der if...then Funktion.
Kann jemand bitte helfen?
Gruß, Paul
code:
Sub fileStandort()
headsheetStandort = "overwiew"
headsheetRisiko = "Standort"
fNameStandort = "Dateistandort"
If WBStandortzieleÖffnen(fNameStandort) = False Then
Workbooks.Open Filename:=ThisWorkbook.Path & "Dateistandort"
End If
End Sub
Function WBStandortzieleÖffnen()
fNameStandort = "Dateistandort"
On Error GoTo Nonexistent
Dim Standortziele As String
fNameStandort = Workbooks(Standortziele).Name
WBStandortzieleÖffnen = True
Exit Function
Nonexistent:
WBStandortzieleÖffnen = False
End Function