Jump to content

Recommended Posts

Posted
Quote

Func giddyup()
    WinActivate("Excel")
    Local $clientpos = WinGetPos("ExcelSpreadsheet")
    Local $buttonsearch = PixelSearch(0, 0, $clientpos[0] + 135, $clientpos[1] + 42, "0xF0E6D2", 0, 0)
    If NOT @error Then
        MouseClick("left", $buttonsearch[0], $buttonsearch[1], 1, 0)
        MouseMove(0, 0, 5)
        Sleep(4000)
        MouseClick("left", $clientpos[0] + 133, $clientpos[1] + 99, 1, 0)
        Sleep(2500)
        If $gmc = 1 Then
            Sleep(2500)
            MouseClick("left", $clientpos[0] + 300, $clientpos[1] + 171, 1, 5)
            Sleep(700)
            MouseMove(0, 0, 0)
         EndIf
        If $gmc = 1 Then
            MouseClick("left", $clientpos[0] + 293, $clientpos[1] + 520, 1, 5)
            Sleep(700)
            MouseMove(0, 0, 0)

i get subscript used non accessible variable when it doesn't sometimes find the pixel in buttonsearch part, is there an error in the code?

Posted

i see, you want to automate excel. Have a look in the helpfile, where you can find all functions of the excel.au3 like

_Excel_BookOpen

 

14 minutes ago, elpillmanno said:

is there an error in the code?

Not in code, a runtime error. You didn't check WinGetPos is succesfull.

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...