Hi Leute,
hab ein Problem mit meinem Script
ich führe das aus: Dropdown_feed()
danach sollte dann
;Ausgabe Dropdown
GUICtrlSetData($dropdown, $dropdownlist)
;Gui Starten
GUISetState()
Passieren aber due Gui wird nicht gestartet ... weiß jemand wieso? es gibt auch keine Fehler
[autoit]#include <File.au3>
#include <Array.au3>
#include <GuiListView.au3>
#include <GUIConstantsEx.au3>
#include <Excel.au3>
;--------------------------------------------------------------------------------
;Globale Variablen
;--------------------------------------------------------------------------------
Global $dropdownlist[1], $bzpath
$bzpath = @ScriptDir & "\test.xlsx"
;--------------------------------------------------------------------------------
;Program Start
;--------------------------------------------------------------------------------
Gui()
[/autoit][autoit][/autoit][autoit];--------------------------------------------------------------------------------
;Funktions
;--------------------------------------------------------------------------------
;#######################################################################################################################
;--------------------------------------------------------------------------------
;Gui
;--------------------------------------------------------------------------------
;########################################################################################################################
Func Gui()
;Lokale Variablen
Local $msg, $dropdown
;Gui anlegen
GUICreate("E und M Dokumente", 800,450)
;Label Anlegen
$welcome = GUICtrlCreateLabel("Wählen Sie das entsprechende BZ aus:", 10, 10, 310, 40)
;Dropdown Box anlegen
$dropdown = GUICtrlCreateCombo("", 10, 40, 200, 20)
;Dropdown Füllen
Dropdown_feed()
;Ausgabe Dropdown
GUICtrlSetData($dropdown, $dropdownlist)
;Gui Starten
GUISetState()
;Warte schleife was passiert
$msg = 0
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
EndSelect
WEnd
EndFunc
;#######################################################################################################################
;--------------------------------------------------------------------------------
;Gui
;--------------------------------------------------------------------------------
;########################################################################################################################
Func Dropdown_feed()
$excelfile = _ExcelBookOpen($bzpath,0)
;$excelfile = _ExcelReadSheetToArray($bzpath)
;Prüfen ob Excel Datei vorhanden ist
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!")
Exit
EndIf
$aArray = _ExcelReadSheetToArray($excelfile)
_ExcelBookClose($excelfile)
;_ArrayDisplay($aArray, "Das Array benutzt die vorgegebenen Parameter")
For $i = 0 To UBound($aArray)-1
$temp = "BZ - " & $aArray[$i]
_ArrayAdd($dropdownlist,$temp)
Next
EndFunc