Excel Help

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Excel Help

25 Jul 2019, 09:50

Hi, I wonder if someone could help with the below? When I export report out of software into excel format. I need the report to maximise to left monitor. Its hit and miss and sometimes opens to left monitor and then doesnt work after export. Also dont know if this is best way of clicking co-ordinates. Additionally, the best way of automating in excel just clicking sceen co-ordinates to select cells columns etc.

Code: Select all

;run sas report


#ifWinactive, Sage 50 Accounts Professional - GRP(UK)LTD
Appskey & z::
CoordMode, Mouse, Screen
Click, 92, 237
Sleep, 200
Click, 940, 92
WinWaitActive, Customer invoice reports ;selects report to run
WinMaximize, A 
CoordMode, Mouse, Screen
Click, 3694, 230
WinWaitActive, Criteria for SAS Excel Incl Sales Order No.    ; enters report criteria
CoordMode, Mouse, Screen
Click, 2872, 592, 2
Sleep, 4000 
Send, {enter}
Sleep, 3000
WinWaitActive, tmp ; excel file beginning name of window title that sage software now exports as excel
Sleep, 2000
Click, 755, 455
Sleep, 500
Send, ^{a}   
Sleep, 500
Send, ^{a}         ; select all in excel 
Sleep, 500
Send, ^+l          ; puts filter on in excel
Sleep, 500
CoordMode, Mouse, Screen
Click, 104, 235, 2         ; clicks to resize columns
Sleep, 500
CoordMode, Mouse, Screen   ; clicks to select which column to drop down filter
Click, 1478, 253
Sleep, 1000
Click 1269, 444
Sleep, 500
Send, bl                    ; types in filter box to filter on "blanks"
Sleep, 500
Send, {enter}
Sleep, 500
Send, #+{Right}             ; want to snap excel report to left screen ** problem is sometimes will open orig on right screen then none of the above works after sending report to excel, its cnrtl a highlight all diff stuff on left screen
Return
#ifWinactive                ; do I need this after every script with scripts below. Below or above Return?
Many Thanks
Last edited by tank on 25 Jul 2019, 12:54, edited 1 time in total.
gregster
Posts: 9067
Joined: 30 Sep 2013, 06:48

Re:

25 Jul 2019, 10:00

It would be great if you started using [code]code goes here[/code] tags around your code (to create these useful codeboxes you can see in many threads) in your posts and adding topic names (see "Subject" line of your post) to your threads, so that people can more easily find/click your threads. (There is also a button that inserts code tags for you, in the forum editor.)

Typing [code]code goes here[/code] literally will create:

Code: Select all

codes goes here
(the code tags are meta tags that influence the appearance of the text in your post; similar to HTML or TeX)


I did that for you in your last topic of today: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=66516 and hoped that the information I left there would inspire you to do it yourself in your next thread.

You can add these things by simpling editing your original post (use the pen icon at the top right of your post; the appearance might depend on your forum theme). Thank you very much!
If you have any further questions concerning the usage of the forum, please ask!
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Re:

25 Jul 2019, 10:25

Apologies I’ll resend correctly when I finish work.

Thanks
hannahelappin
Posts: 53
Joined: 01 Jun 2019, 09:02

Re:

25 Jul 2019, 10:26

I didn’t realise you’d done that for me sorry I thought the forum some how detects it and had defaulted to correct format.
gregster
Posts: 9067
Joined: 30 Sep 2013, 06:48

Re:

25 Jul 2019, 10:33

hannahelappin wrote:
25 Jul 2019, 10:25
Apologies I’ll resend correctly when I finish work.

Thanks
Okay, thank you!
No worries, it will be alright if you just edit your first post above ⬆⬆⬆ and add topic name/subject and code tags around your code.
(No need to completely re-post it in a new thread.)
I didn’t realise you’d done that for me sorry I thought the forum some how detects it and had defaulted to correct format.
I assumed that, so I thought that I would let you know and let you edit your post yourself, this time. I don't mind adding it, if someone forgets it, but yeah, that might not always help newer users to get used to how the forum works...

To clarify:
Press edit button on your first post to get into edit mode:
edit button.png
edit button.png (1.15 KiB) Viewed 780 times
Please fill Subject field and use code tags button in edit mode:
subject line and code tags button.png
subject line and code tags button.png (14.77 KiB) Viewed 780 times
If you select the code part first in the editor and then press the code button, the code tags will be put around the selection. Finally, please press Submit to save the changes.

Edit: I see a white knight came to your rescue. Anyway, this is of course also applicable to future posts and threads...
toralf
Posts: 868
Joined: 27 Apr 2014, 21:08
Location: Germany

Re: Excel Help

25 Jul 2019, 14:25

Regarding you original question.
Clicking coordinates are simple but as you discovered also not very robust.
This it is not recommended.
The most robust way with Excel is to use the COM interface. If you search the forum for this it will bring up several examples.
Regarding positioning the windows to a certain area, you could use some of the AHK Win... commands
ciao
toralf

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot] and 156 guests