Fehler im VBA Code
08.09.2003 15:14:45
Roddel
ich bekomme für die Zeile:
xlAnw.Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
Formula1:="=HEUTE()+36524"
die Fehlermeldung: Ungültiger Prozeduraufruf
Kann jemand den Fehler entdecken?
Gesamter Code:
Set xlAnw = CreateObject("excel.application")
xlAnw.Visible = True ' läuft unsichtbar im Hintergrund
xlAnw.Workbooks.Open FileName:=excelname
xlAnw.Columns("L:L").Select
xlAnw.Selection.FormatConditions.Delete
xlAnw.Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _
Formula1:="=HEUTE()+36524"
With xlAnw.Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 3
End With
xlAnw.Selection.FormatConditions(1).Interior.ColorIndex = 6
xlAnw.Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:="74876"
xlAnw.Selection.FormatConditions(2).Interior.ColorIndex = 6
Set xlAnw = Nothing