Hello everyone, I need your help because my program does not work in a program called "facturacion", only WinActivate works.
I try to use "send()", "Controlsend()" or send text with an "array[ ]" but nothing works.
This is my code:
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <Excel.au3>
#include <Array.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Ventana", 200, 250, 300, 50)
GUICtrlCreateLabel("Orden de Compra",20,10)
Global $compra = GUICtrlCreateInput("123456",20,30,90,20)
GUICtrlCreateLabel("No. de casillas",20,60)
Global $casillas = GUICtrlCreateInput("1",20,80,90,20)
$boton = GUICtrlCreateButton("boton",40,150,100,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $boton
Local $sWorkbook = @ScriptDir & "\facturacion.xlsx"
$oWorkbook = _Excel_BookAttach($sWorkbook)
Global $array[0]
Local $num = "2"
For $i = 1 To GuiCtrlRead($casillas)
$c = $oWorkBook.ActiveSheet.Range("C" & $num).value
$b = $oWorkBook.ActiveSheet.Range("B" & $num).value
$a = $oWorkBook.ActiveSheet.Range("A" & $num).value
_ArrayAdd($array, $c)
_ArrayAdd($array, $b)
_ArrayAdd($array, $a)
$num = $num + 1
Next
WinActivate("Complemento Carta Porte - Mercancías","")
;;; this does not work
Send("alex")
ControlSend("Complemento Carta Porte - Mercancías","","TMCCEditMascara11","hola")
Send($array[1])
;;;
EndSelect
Wend
Exit
I think it's something from the program "Facturacion" because if I want to use "send()", "Controlsend()" or send text with an "array[ ]" in another program it works correct.
sorry for my english, google helped me
pruebas.au3