Jump to content

The Mouse is on the wrong screen when my script runs.


TimK
 Share

Recommended Posts

HI, 

I am very new to Autoit, I am opening up an Excel file and relinking to a web page to get my data update.  It all works fine if the mouse arrow is on the same screens at the Excel file. 

I tried the following, but it just moved the mouse to the upper corner left screen, my excel file is on the right screen.  I need mouse to move the Excel file every time.  

thanks for the help

local Const $ExcelFile = "File Path", $TargetSheet = "Sheet1"
Local $oExcel = _Excel_Open()
$oWorkbook = _Excel_BookOpen($oExcel, $ExcelFile)
Sleep (15000)
$oWorkbook.Sheets($TargetSheet).Activate
WinwaitActive($TargetSheet,"SetFocus", 5)
Mousemove(0,0,10)
MouseClick("Left")
Sleep (3000)

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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