Hallo Autoit - Team,
ich programmiere grade (aus langeweile) ein Programm das Exceldateien in txt Dateien umwandelt. doch habe ich ein Problem mit der _ExcelReadArray Befehl. unter der Stelle wo ich die Zellenreichweite eintragen soll habe ich eine Variable eingetragen doch wenn ich eine Variable eintrage kommt im @error eine 3 für Fehlerhafte Zellenangabe. doch sobald ich die Zahle manuel ohne der Variable eintrage ist kein Problem mehr Vorhanden.
#include <Excel.au3>
#include <Array.au3>
Global $line, $datensatz, $inhalt, $line2, $date[64]
Global $breite = InputBox("Breite ?","Wie weit soll in die Breite kopmpremiert werden? (Max. = 64)","")
If @error = 1 Then
Exit
EndIf
Global $tiefe = InputBox("Tiefe ?","Wie weit soll in die Tiefe kopmpremiert werden? (In Zahl)","")
If @error = 1 Then
Exit
EndIf
Global $xlsx = FileOpenDialog("Zu verarbeitende Datei öffnen.", @DesktopDir& "\", "Excel Datei(*.xls;*.xlsx)", 1 + 2 )
If @error = 1 Then
Exit
EndIf
Global $txt= FileSaveDialog( "Wähle einen Namen.", @DesktopDir& "\", "Textdatei(*.txt)",2 + 16)
If @error = 1 Then
Exit
EndIf
Global $teiler = InputBox("Teiler ?","Was für ein Teiler soll zwischen den ergebnissen sein?",";")
If @error = 1 Then
Exit
EndIf
Global $excel = _ExcelBookOpen($xlsx)
$line = 1
$line2 = 1
While 1
If $line > $tiefe Then
ExitLoop
EndIf
Global $date = _ExcelReadArray($excel, $line, 1, $breite) <--------------------------------------
MsgBox(0,"",@error)
_ArrayDisplay($date)
While 1
$i = $i + 1
If $line2 > $breite Then
ExitLoop
EndIf
$inhalt = $inhalt & $date[$i]
MsgBox(0,"",$inhalt)
WEnd
FileWriteLine($txt,$inhalt)
$inhalt = ""
$line2 = 1
WEnd
Gruß Raumen837/ Patrick