ich hatte eigentlich vor meine Excel Liste zu speichern ohne das der User eingreifen muss. Also wenn er das Fenster schließt weiß Excel schon, wo es sich hinspeichern muss. Leider speichert Excel nicht die Datei, hier der Code:
Code: Alles auswählen
Excel_Temp$ = "C.\users\joel\desktop\testexcel.xls"
XIncludeFile "COMatePLUS.pbi"
date$ = FormatDate("%dd/%mm/%yyyy", Date())
Define.COMateObject ExcelObject, WorkBook
ExcelObject = COMate_CreateObject("Excel.Application")
If ExcelObject
If ExcelObject\SetProperty("Visible = #True") = #S_OK
WorkBook = ExcelObject\GetObjectProperty("Workbooks\Add")
If WorkBook
ExcelObject\SetProperty("Cells(1,1) = 'Datum:'")
ExcelObject\SetProperty("Cells(1,2) = '" + date$ + "' AS DATE")
ExcelObject\SetProperty("Application\DisplayAlerts = #False")
Workbook\Invoke("SaveAs('Excel_Temp$')")
ExcelObject\SetProperty("Application\DisplayAlerts = #True")
WorkBook\Release()
EndIf
EndIf
ExcelObject\Release()
Else
MessageRequester("Excel Datei erstellen", "Couldn't create the application object!")
EndIf
Code: Alles auswählen
Workbook\Invoke("SaveAs('Excel_Temp$')")