Jump to content

Recommended Posts

Posted

Hello, 

Please help me with a command to select "Date and time" option from the drop down menu below.

i tried several commands from this forum, but none with success.

image.png.2554a3d0b519d708af04933b03bc2eb5.png

Thanks in advance !

Posted

Hello, 

thanks for your quick answer.

Here's the partial script i wrote. If i would manage to select the option from the drop down menu, the rest of the script runs smooth (it fills the date now, but in different location because "Z reports" is selected), It also clicks the Set connection button as well.

 

Posted

; Start anaf_Download.exe
Run("C:\Users\s009pos10\Desktop\anaf_Download.exe")
; Wait until the window with ANAF files - downloader title becomes active
Local $hWnd = WinWaitActive("ANAF files - downloader","")
; Expand Range type, Search for Date and time and Select it
ControlCommand($hWnd, "", "TNewComboBox1", "SelectString", "Date and time")
; Write From and to
Send("01.03.2020")
Send("{TAB}")
Send("31.03.2020")
Sleep(2000)

; Define members
Local $clicked = 0
Local $buttonName = "Set connection"
Local $timeout = 10

; Wait recursively 5 seconds for active button
For $i = 1 To $timeout Step 1
      ; Check if the Set connection button is active
      If ControlCommand($hWnd, "", $buttonName, "IsEnabled", "") <> 0 Then
         ; Click the button and end the loop
         $clicked = ControlClick($hWnd, "", "[TEXT:" & $buttonName & "]")
         If $clicked = 1 Then
            ExitLoop
         EndIf
      EndIf
      Sleep(1000)
Next

Posted

I'm sorry, i am confused, it's my first time using commands, can you give me an example, please?Would be so kind of you

Posted

@KillaB
There you go:

#include <GuiComboBoxEx.au3> ; This include is needed in order to use _GUICtrlComboBox* functions

Global $hWnd, _
       $hdlComboBox

; Start anaf_Download.exe
Run("C:\Users\s009pos10\Desktop\anaf_Download.exe")

; Wait until the window with ANAF files - downloader title becomes active
$hWnd = WinWaitActive("ANAF files - downloader","")

; Getting the Handle of the ComboBox control
$hdlComboBox = ControlGetHandle($hWnd, "", "[CLASSNN:TNewComboBox1]")

If IsHWnd($hdlComboBox) Then
    If _GUICtrlComboBox_SetCurSel($hdlComboBox, 0) <> -1 Then MsgBox(0, "", "Item selected!", 5)
EndIf

Study the sample :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...