Fehler beim erstellen einer Excel Tabelle

  • moin moin,

    bekomme immer einen Fehler " Line 7927 " und " Error: The requested action with this object has failed. "
    wenn ich mein Autoit Programm auf einen anderen Rechner ausführe.
    Bei meinen Rechner funktioniert das einwandfrei. Habe da Excel 2003 drauf und auf dem anderen mit der Fehlermeldung ist Excel 97 drauf.
    Mein Problem ist das es mit beiden Excel Versionen laufen soll.

    Hier mal der code Teil von meinen Skript.

    Spoiler anzeigen
    [autoit]

    Func allgemein() ; Wird die Data1 Tabelle bearbeitet
    $aviall = GUICreate("Bitte Warten", 417, 109, 249, 135, BitOR($WS_SIZEBOX,$WS_THICKFRAME,$WS_CAPTION,$WS_POPUP,$WS_BORDER,$WS_CLIPSIBLINGS)) ; Gui für das warten AVI
    $Avi1 = GUICtrlCreateAvi(@ScriptDir & "\2.AVI", -1, 70, 40, 393, 57)
    GUICtrlSetState($Avi1, 1)
    $Label1 = GUICtrlCreateLabel("Excel Tabelle wird erstellt", 75, 8, 300, 24)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    GUISetState(@SW_SHOW)
    GUISetOnEvent($GUI_EVENT_CLOSE, "end")
    FileDelete(@ScriptDir & "\Liste\Data1.xls") ; Die alte Data1.xls wird gelöscht
    FileCopy("C:\Kaver\Data1\Data1.xlt", @ScriptDir & "\Liste\Data1.csv", 9) ; Kopieren der Datei (Data1.xls ) und benenne diese in *.csv
    $sFilePath1 = @ScriptDir & "\Liste\Data1.csv"
    $oExcel =_ExcelBookOpen ($sFilePath1, $fVisible = 1) ; Datei wird unsichtbar geöffnet
    If @error = 1 Then
    MsgBox(0, "Fehler!", "Das Excel-Objekt konnte nicht erstellt werden")
    Exit
    ElseIf @error = 2 Then
    MsgBox(0, "Fehler!", "Die Datei existiert nicht!")
    EndIf
    $oExcel.ActiveSheet.PageSetup.PrintArea = "" ; Hier kann man den Druckbereich Einstellen
    With $oExcel.ActiveSheet.PageSetup
    .LeftHeader = ""
    .CenterHeader = ""
    .RightHeader = ""
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = ""
    .LeftMargin = $oExcel.Application.InchesToPoints(0.787401575)
    .RightMargin = $oExcel.Application.InchesToPoints(0.787401575)
    .TopMargin = $oExcel.Application.InchesToPoints(0.984251969)
    .BottomMargin = $oExcel.Application.InchesToPoints(0.984251969)
    .HeaderMargin = $oExcel.Application.InchesToPoints(0.4921259845)
    .FooterMargin = $oExcel.Application.InchesToPoints(0.4921259845)
    .PrintHeadings = False
    .PrintGridlines = False
    .PrintComments = -4142 ; xlPrintNoComments = -4142
    .PrintQuality = 200
    .CenterHorizontally = False
    .CenterVertically = False
    .Orientation = 2 ; xlLandscape = 2
    .Draft = False
    .PaperSize = 9 ; xlPaperA4 = 9
    .FirstPageNumber = -4105 ; xlAutomatic = -4105
    .Order = 1 ; xlDownThenOver = 1
    .BlackAndWhite = False
    .Zoom = 60
    .PrintErrors = 0 ; xlPrintErrorsDisplayed = 0
    EndWith
    $oExcel.Range("A1").Select
    $oExcel.Selection.ClearContents
    $oExcel.Range("A:AZ").Select ;----Makiert das Blatt von A bis AZ
    $oExcel.Selection.EntireColumn.AutoFit ; Passt die Zellengröße Automatisch an
    $oExcel.Columns("A:A").ColumnWidth = 10.40 ;----Passt die Zellengröße mit Größenangabe an
    $oExcel.Columns("B:B").ColumnWidth = 10.40
    $oExcel.Columns("C:C").ColumnWidth = 10.40
    $oExcel.Columns("D:D").ColumnWidth = 12.00
    $oExcel.Columns("E:E").ColumnWidth = 10.00
    $oExcel.Selection.HorizontalAlignment = -4108 ;----setzt alles makierte auf mitte
    $oExcel.ActiveSheet.Range("A1:A1").Select
    $oExcel.ActiveCell.EntireRow.Insert (1);----->fügt eine Zeile hinzu
    $oExcel.ActiveSheet.Range("A1:A1").Select
    $oExcel.ActiveCell.EntireRow.Insert (1)
    $oExcel.ActiveSheet.Range("A1:A1").Select
    $oExcel.ActiveCell.EntireRow.Insert (1)
    $oExcel.ActiveSheet.Range("A1:A1").Select
    $oExcel.ActiveCell.EntireRow.Insert (1)
    $oExcel.ActiveSheet.Range("A1:A1").Select
    $oExcel.ActiveCell.EntireRow.Insert (1)
    _ExcelColumnInsert($oExcel, 3, 1) ; Fügt eine neue Spalte ein hinter der zweiten Spale (B)ein
    $oExcel.ActiveSheet.Pictures.Insert("D:\Bilder\Programme\Skripte\3.bmp").Select ;---- setzt das Logo auf A1
    $oExcel.Columns("A:C").Select
    $oExcel.Range("A6").Activate
    $oExcel.Selection.NumberFormat = "0,00" ; War ein Pungt und wurde durch ein komma ersezt
    $oExcel.Columns("F:AZ").Select
    $oExcel.Selection.NumberFormat = "0,00"
    $oExcel.Cells(1,6).Value = "Leitender :" ;-----Schreibt in eine Zelle einen Text
    $oExcel.Cells(2,6).Value = "zu :"
    $oExcel.Columns("F:F").ColumnWidth = 13.30 ;----Passt die Zellengröße mit Größenangabe an
    $oExcel.Cells(3,6).Value = "Abt. "
    $oExcel.Cells(4,6).Value = "Bericht vom :"
    $oExcel.Cells(3,9).Value = "von :"
    $oExcel.Cells(7,3).Value = "Distanz"
    $oExcel.Cells(9,3).Value = "[m]"
    $oExcel.Range("I3").Select
    $oExcel.Selection.Font.Bold = True
    $oExcel.Rows("1:1").RowHeight = 21.75 ; Hier wird die Zelle breiter gemacht und dann auch in fett und 12 geschrieben
    $oExcel.Range("G1:J1").Select
    With $oExcel.Selection.Font
    .Name = "Arial"
    .Size = 12
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    EndWith
    $oExcel.Selection.Font.Bold = True ; Hier werden die Zellen in Fett Formatiert
    $oExcel.Rows("7:9").Select
    With $oExcel.Selection.Font
    .Name = "Arial"
    .FontStyle = "Fett"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    EndWith
    $oExcel.Rows("6:6").Select
    $oExcel.Selection.Delete.Shift= -4162 ;xlUp = -4162
    $oExcel.Range("A5:C5").Select ; Makiert den zu bearbeitenden Bereich ( Select )
    With $oExcel.Selection ;Stellt mir die Makierten Zellen wieder auf Linksbündig
    .HorizontalAlignment = -4131
    .VerticalAlignment = -4107
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = -5002
    .MergeCells = False
    EndWith
    $oExcel.Range("F1:F4").Select ; Hier werden einzelne Zellen F1-F3 Links ausgerichtet
    With $oExcel.Selection
    .HorizontalAlignment = -4131 ;xlLeft
    .VerticalAlignment = -4107 ;xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = -5002 ;xlContext
    .MergeCells = False
    EndWith
    $oExcel.Range("F1:F4").Select ; Rahmen um den Kopf
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    With $oExcel.Selection.Borders(7) ; xlEdgeLeft = 7
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(8) ; 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(12).LineStyle = -4142 ; xlInsideHorizontal = 12, xlNone = -4142
    With $oExcel.Selection.Font
    .Name = "Arial"
    .FontStyle = "Fett"
    .Size = 10
    .Strikethrough = False
    .Superscript = False
    .Subscript = False
    .OutlineFont = False
    .Shadow = False
    EndWith
    $oExcel.Range("G1:J1").Select ; Zellen Verbinden von G1-J1
    With $oExcel.Selection
    .HorizontalAlignment = -4108 ;xlCenter
    .VerticalAlignment = -4107 ;xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder = -5002 ;xlContext
    .MergeCells = True
    EndWith
    $oExcel.Range("G2:J2").Select ; Zellen Verbinden von G2-J2
    With $oExcel.Selection
    .HorizontalAlignment = -4108 ;xlCenter
    .VerticalAlignment = -4107 ;xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder =-5002 ;xlContext
    .MergeCells = True
    EndWith
    $oExcel.Range("G3:H3").Select ;Zellen Verbinden von G3-H3
    With $oExcel.Selection
    .HorizontalAlignment = -4108 ;xlCenter
    .VerticalAlignment = -4107 ;xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder =-5002 ;xlContext
    .MergeCells = True
    EndWith
    $oExcel.Range("A:AZ").Select ;----Makiert das Blatt von A bis AZ
    $oExcel.Selection.EntireColumn.AutoFit ; Passt die Zellengröße Automatisch an
    $oExcel.Columns("A:A").ColumnWidth = 10.40 ;---- Passt die Zellengröße mit Größenangabe an
    $oExcel.Columns("B:B").ColumnWidth = 10.40
    $oExcel.Columns("C:C").ColumnWidth = 10.40
    $oExcel.Columns("D:D").ColumnWidth = 12.00
    $oExcel.Columns("E:E").ColumnWidth = 10.00
    $oExcel.Columns("J:J").ColumnWidth = 13.00
    $oExcel.Cells(5,1).Value = "Adresse";-----Screibt in eine Zelle einen Text
    $oExcel.Range("A1:E5").Select ; Hinter dem Logo die Zellen Verbinden mit der Adresse
    With $oExcel.Selection
    .VerticalAlignment = -4107 ; xlBottom =-4107
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .ShrinkToFit = False
    .ReadingOrder = -5002 ; xlContext = -5002
    .MergeCells = True
    EndWith
    $oExcel.Columns("A:AZ").Select ; Senkrechte Rahmen Linien
    $oExcel.Range("A6").Activate
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    With $oExcel.Selection.Borders(7) ; xlEdgeLeft = 7
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(9).LineStyle = -4142 ; 9 = xlEdgeBottom, xlNone = -4142
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(11) ; xlInsideVertical =11
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith ; ENDE Senkrechte Rahmen Linien
    $oExcel.Rows("6:8").Select ; Rahmen um die Maße und der Beschreibung
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    With $oExcel.Selection.Borders(7) ; xlEdgeLeft = 7
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(8) ; 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(12).LineStyle = -4142 ; xlInsideHorizontal = 12, xlNone = -4142 ; ENDE Rahmen um die Maße und der Beschreibung
    $oExcel.Range("G1:J3").Select ; Rahmen Kopf
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    With $oExcel.Selection.Borders(7) ; xlEdgeLeft = 7
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(8) ; 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(11) ; xlInsideVertical = 11
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(12) ; xlInsideHorizontal = 12
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith ; ENDE Rahmen Kopf
    $oExcel.Range("J3").Select ; Rahmen entfernen
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    $oExcel.Selection.Borders(7).LineStyle =-4142 ; xlEdgeLeft = 7, xlNone = -4142
    With $oExcel.Selection.Borders(8); 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith ; ENDE Rahmen bei TelNr. wegmachen
    $oExcel.Range("G4:J5").Select ;--- Hier werden die Ränder entfernt die zu viel waren
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    $oExcel.Selection.Borders(7).LineStyle =-4142 ; xlEdgeLeft = 7, xlNone = -4142
    With $oExcel.Selection.Borders(8); 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(12).LineStyle = -4142 ; xlInsideHorizontal = 12, xlNone = -4142
    $oExcel.Selection.Borders(10).LineStyle = -4142 ; xlEdgeRight =10, xlNone = -4142
    $oExcel.Selection.Borders(11).LineStyle = -4142 ; xlInsideVertical = 11, xlNone = -4142
    $oExcel.Range("G4:J4").Select ; Hier wird der Ramen wieder geschlossen und die Zellen verbunden
    With $oExcel.Selection
    .HorizontalAlignment = -4108 ;xlCenter
    .VerticalAlignment = -4107 ;xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder =-5002 ;xlContext
    .MergeCells = True
    EndWith
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    With $oExcel.Selection.Borders(7) ; xlEdgeLeft = 7
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(8); 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(10) ; 10 = xlEdgeRight
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(11).LineStyle = -4142 ; xlInsideVertical = 11, xlNone = -4142
    $oExcel.Range("K1:AZ5").Select ; Hier wird der rest von den Rahmenlinien rechts neben dem Kopf entfernt
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    $oExcel.Selection.Borders(8).LineStyle = -4142 ; xlEdgeTop = 8, xlNone = -4142
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(12).LineStyle = -4142 ; xlInsideHorizontal = 12, xlNone = -4142
    $oExcel.Selection.Borders(10).LineStyle = -4142 ; xlEdgeRight =10, xlNone = -4142
    $oExcel.Selection.Borders(11).LineStyle = -4142 ; xlInsideVertical = 11, xlNone = -4142
    $oExcel.Range("F5:J5").Select ; Hier weden die Zeilen verbunden unter dem Kopf und eine Rahmenlinie entfernt
    With $oExcel.Selection
    .HorizontalAlignment = -4108 ;xlCenter
    .VerticalAlignment = -4107 ;xlBottom
    .WrapText = False
    .Orientation = 0
    .AddIndent = False
    .IndentLevel = 0
    .ShrinkToFit = False
    .ReadingOrder =-5002 ;xlContext
    .MergeCells = True
    EndWith
    $oExcel.Selection.Borders(5).LineStyle = -4142 ; xlDiagonalDown = 5, xlNone = -4142
    $oExcel.Selection.Borders(6).LineStyle = -4142 ; xlDiagonalUp = 6, xlNone = -4142
    $oExcel.Selection.Borders(7).LineStyle =-4142 ; xlEdgeLeft = 7, xlNone = -4142
    With $oExcel.Selection.Borders(8); 8 = xlEdgeTop
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    With $oExcel.Selection.Borders(9) ; 9 = xlEdgeBottom
    .LineStyle = 1 ;xlContinuous = 1
    .Weight = -4138 ;xlMedium = -4138
    .ColorIndex = -4105 ;xlAutomatic = -4105
    EndWith
    $oExcel.Selection.Borders(10).LineStyle = -4142 ; xlEdgeRight =10, xlNone = -4142
    $oExcel.Selection.Borders(11).LineStyle = -4142 ; xlInsideVertical = 11, xlNone = -4142
    $oExcel.Range("G4:J4").Select
    $oExcel.Selection.NumberFormat = ""
    $oExcel.Range("L1").Select
    _ExcelBookSaveAs($oExcel, @ScriptDir & "\Liste\Data1.xls")
    _ExcelBookClose($oExcel)
    $textkopf1 = FileOpen(@ScriptDir & "\Liste\kopf.log", 0); wird die kopf log erstellt damit die Daten gespeichert werden können
    $date = @MDAY&"."&@MON&"."&@YEAR
    _FileWriteToLine(@ScriptDir & "\Liste\kopf.log", 7, $date, 1)
    FileClose($textkopf1)
    $textkopf = FileOpen(@ScriptDir & "\Liste\kopf.log", 0); wird die kopf log erstellt damit die Daten gespeichert werden können
    If $textkopf = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
    EndIf
    $es1 = FileReadLine($textkopf, 1) ; Die Zeilen aus der kopf.log lesen
    $es2 = FileReadLine($textkopf, 2)
    $es3 = FileReadLine($textkopf, 3)
    $es4 = FileReadLine($textkopf, 4)
    $es5 = FileReadLine($textkopf, 5)
    $es6 = FileReadLine($textkopf, 6)
    $es7 = FileReadLine($textkopf, 7)
    FileClose($textkopf)
    $sFilePath1 = @ScriptDir & "\Liste\Data1.xls"
    $oExcel =_ExcelBookOpen ($sFilePath1, $fVisible = 1)
    _ExcelWriteCell($oExcel, $es1, 1, 7) ; Die Zeilen aus der Kopf.log in die Tabelle schreiben
    _ExcelWriteCell($oExcel, $es2, 3, 7)
    _ExcelWriteCell($oExcel, $es3, 3, 10)
    _ExcelWriteCell($oExcel, $es4, 2, 7)
    _ExcelWriteCell($oExcel, $es5, 2, 11)
    _ExcelWriteCell($oExcel, $es5, 3, 11)
    _ExcelWriteCell($oExcel, $es7, 4, 7)
    _ExcelBookSaveAs($oExcel, @ScriptDir & "\Liste\Data1.xls")
    FileDelete(@ScriptDir & "\Liste\Data1.csv")
    _ExcelBookClose($oExcel)
    $sFilePath1 = @ScriptDir & "\Liste\Data1.xls"
    $oExcel1 =_ExcelBookOpen ($sFilePath1, $fVisible = 0)
    If $aviall = True Then ; Das "Bitte Warten"AVI schließen
    GUIDelete($aviall)
    EndIf
    EndFunc ;==>allgemein

    [/autoit]

    Was kann man da machen um diesen Fehler einzugrenzen oder ihn zu beheben ?


    mfg
    oh-ha

    Es gibt drei Wahrheiten: deine Wahrheit, meine Wahrheit und die Wahrheit

    Einmal editiert, zuletzt von oh-ha (19. Januar 2010 um 11:43)

  • Ja und was steht bei die in "Line 7927" ?

    Andy hat mir ein Schnitzel gebacken aber da war ein Raupi drauf und bevor Oscar das Bugfixen konnte kam Alina und gab mir ein AspirinJunkie.

  • naja die habe ich gar nicht in meinen Skript das hat nur ca. 2000 Zeilen und in der Excel Tabelle ist es eine ganz normale Zeile wie alle anderen auch.
    Versuche ich eine andere Tabelle zu öffnen bekomme ich die Line 8371 als Fehler angezeigt.


    mfg
    oh-ha

    Es gibt drei Wahrheiten: deine Wahrheit, meine Wahrheit und die Wahrheit

  • Hi,

    Du führst die exe auf den anderen Rechner aus. Damit bekommst Du keine reproduzierbaren Fehlermeldungen mehr.
    Du musst Dein au Script ausführen.

    Meiner Vermutung nach, bekommst Du die Fehler nur auf den Rechnern, auf denen Office97 installiert ist.
    Sehr wahrscheinlich werden nicht alle Com Objekte unterstützt

    ;-))
    Stefan

  • Hallo ojo,

    hmm muss ich also autoit auf den anderen Rechner Installieren.
    Puh wird meiner Tochter aber gar nicht gefallen :D
    Danke dir erst einmal, werde das mal so machen und dann mal weiterschauen.


    mfg
    oh-ha

    Es gibt drei Wahrheiten: deine Wahrheit, meine Wahrheit und die Wahrheit

  • Nur um das abzuschließen.

    Der fehler lag in der Printanweisung: Zeile 36 und 46

    .

    [autoit]

    .PrintQuality = 200

    [/autoit]

    und

    [autoit]

    .PrintErrors = 0 ; xlPrintErrorsDisplayed = 0

    [/autoit]

    habe diese beiden einfach gelöscht und nun rennt es auch auf Excel 97.


    mfg
    oh-ha

    Es gibt drei Wahrheiten: deine Wahrheit, meine Wahrheit und die Wahrheit