Note that there are some explanatory texts on larger screens.

plurals
  1. POMove Mouse - VBScript and Excel Macro
    primarykey
    data
    text
    <p>Found a script that uses Excel to move the mouse in VBScript. This is almost exactly what I am looking for for my project, however I need to alter a small bit to enable me to enter coordinates in the code for it to move the mouse specifically to those coordinates; the code currently uses the current mouse position and moves from that position - I need to be able to have the mouse move to an ABSOLUTE position, not a RELATIVE one.</p> <p>Here's the VBS code:</p> <pre><code>Option Explicit Dim Excel, GetMessagePos, x, y, Count, Position Set Excel = WScript.CreateObject("Excel.Application") GetMessagePos = Excel.ExecuteExcel4Macro( _ "CALL(""user32"",""GetMessagePos"",""J"")") x = CLng("&amp;H" &amp; Right(Hex(GetMessagePos), 4)) y = CLng("&amp;H" &amp; Left(Hex(GetMessagePos), (Len(Hex(GetMessagePos)) - 4))) Position = "+ 180" Position = "- 180" Excel.ExecuteExcel4Macro ( _ "CALL(""user32"",""SetCursorPos"",""JJJ""," &amp; x &amp; " " &amp; Position &amp; "," &amp; y &amp; " " &amp; Position &amp; ")") WScript.Sleep (100) WScript.Echo "Program Ended" </code></pre> <p>According to the code, the position of the mouse is moved from it's CURRENT POSITION +180 then -180. I need this code altered so I can put both the positions (in variable names X and Y) and use those to set the exact position of the mouse pointer. </p> <p>I have messed around with the Excel.ExecuteExcel4Macro part and checked out the documentation for the function to no avail. Please can you help? Thanks :)</p> <p>EDIT: I'm using VBScript because the system I am creating this on is VERY locked down. I have no way of using any other technologies bar this one, so help would be appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload