Hallo Zusammen
Bitte, möchte mein script erweitern und zwar nach auswahl der "Firma" sollte nach drücken des Buttons "Offerte" die restlichen Informationen wie z.B. Name, Vorname, Strasse, und Ort aus der entsprechender Zeile gezogen werden.
Währe wirklich sehr dankbar um hilfe.
MC
Spoiler anzeigen
#include<Array.au3>
;#include<ExcelCOM_UDF.au3>
#include<Excel.au3>
Opt('MustDeclareVars', 1)
ArrayMuster()
Func ArrayMuster()
Global $aIni, $nMsg, $Exit, $ab, $Offerte, $mwRechnung, $owRechnung, $Exit, $aFirma, $combobox
Global $xls, $xlsdir, $app, $zelle, $zeile, $open
Local $aFileName, $aArray1, $oExcel
$aFileName = ("C:\temp\Script\Firmenmusteradressen.xls")
$oExcel = _ExcelBookOpen($aFileName) ;Open book, make it not visible
$oExcel.Visible = 0
$aArray1 = _ExcelReadArray($oExcel, 2, 1, 11, 1) ;Direction is Vertical
_ArrayDisplay($aArray1, "Arrray Range FIRMA")
$oExcel = _ExcelBookClose($aFileName)
$aFirma = _ArrayToString($aArray1)
GUICreate("GUI", 300, 260)
GUICtrlCreateLabel("Firma ", 10, 10)
$combobox = GUICtrlCreateCombo("", 10, 30, 190)
GUICtrlSetData($combobox, $aFirma)
$ab = GUICtrlCreateButton("Abestätigung",70, 130)
$Offerte = GUICtrlCreateButton("Offerte",10, 130)
$mwRechnung = GUICtrlCreateButton("Rechnung mit WIR",150, 130)
$owRechnung = GUICtrlCreateButton("Rechnung ohne WIR",150, 160)
$Exit = GUICtrlCreateButton("Exit",60, 200)
GUISetState()
[/autoit] [autoit][/autoit] [autoit]If Not FileExists($aFileName) Then ; Neu zur Überprüfung hinzu
MsgBox(0, "Hinweis:", "XLS-Datei existiert nicht.")
Exit
EndIf
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Exit
;MsgBox(1,"Auswahl", GUICtrlRead($MengenCombo[0])&GUICtrlRead($MengenCombo[1])& _
; GUICtrlRead($MengenCombo[2])&GUICtrlRead($MengenCombo[3]))
Exit
Case $mwRechnung
Run("C:\Program Files\Microsoft Office\Office12\excel")
Exit
Case $owRechnung
Run("C:\Program Files\Microsoft Office\Office12\excel")
Exit
Case $Offerte
;Msgbox(1,"", $combobox)
;$xls = ShellExecute("C:\temp\Script\OffertenvorlageNEU.xls")
$xlsdir = "C:\temp\Script\OffertenvorlageNEU.xls"
;Excel öffnen
$app = ObjCreate("Excel.application")
$app.Visible = true
$open = $app.Workbooks.Open ($xlsdir)
;in Excel schreiben
$app.Cells(10,4).Value = ""&GUICtrlRead($combobox)&""
$zelle=6
$zeile=1
$app.Cells($zeile,$zelle).Value = ""
;$open = $app.Workbooks.Close($xlsdir)
Exit
EndSwitch
WEnd
EndFunc