ich bin gerade an einer Datenbank für unsere Wohngruppe...
es geht darum Ordner und Dateien zu erstellen -funzt auch zumindest beim ersten mal...
beim zweiten mal meldet sich der Debugger!
hier der Code:
Dim spath As String
Dim ordnernam As String
Dim appWord As Object
Dim doc As Object
spath = ThisWorkbook.Path
ordnernam = Sheets("Inhalt").Range("B4") ' Anpassen
MkDir (spath & "\" & ordnernam)
Application.DisplayAlerts = False
Set appWord = CreateObject("Word.Application")
Set doc = appWord.Documents.Open(spath & "\02Spezifische Behinderungen.dot")
'Application.DisplayAlerts = True
'doc.PrintOut
doc.SaveAs spath & "\" & ordnernam & "\" & [A3].Value & "_" & [B7].Value & ".doc"
appWord.Quit
Set doc = Nothing
Set appWord = Nothing
End Sub
wie kann ich das Makro stoppen - wenn Ordner bereits vorhanden ist?
vielen Dank
Gruß