du hast mir gestern frendlicher weise für mein Problem diesen Code gschriegen,
wenn ich den jetzt in mein Projekt reikopieren kommt folgender Laufzeitfehler:
VBA-Projekte und XML-Blätter können in einer Arbeitsmappe ohne MAKROS nicht gespeichert werden!
Kannst du mir das Problem noch lösen?
Gruß Paul
' **********************************************************************
' Modul: Modul1 Typ: Allgemeines Modul
' **********************************************************************
Option Explicit
Private Declare
Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long
Sub Akte_anlegen()
Dim strFilePath As String, strRoot As String
strRoot = Sheets("StDa").Range("A19").Text
If Right(strRoot, 1) "\" Then strRoot = strRoot & "\"
With Sheets("Daten")
strFilePath = strRoot & .Range("L8").Text & "\" & .Range("C12").Text & _
.Range("K2").Text & " " & .Range("O2").Text & ".xls"
End With
If MakeSureDirectoryPathExists(strFilePath) 0 Then
ActiveWorkbook.SaveAs Filename:=strFilePath
Else
MsgBox "Fehler!"
End If
End Sub