Since you already know VBA, it should be relatively easy for you to use COM. It will be much more reliable that sending mouse clicks.
This example, for starters:
Basic Ahk_L COM Tutorial for Excel
Search found 76 matches
- 21 Sep 2020, 21:21
- Forum: Ask For Help
- Topic: Loop through Excel list (with hyperlinks)
- Replies: 3
- Views: 110
- 26 Jul 2020, 08:40
- Forum: Ask For Help
- Topic: Excel: Find address of selection using COM Topic is solved
- Replies: 10
- Views: 3508
Re: Excel: Find address of selection using COM Topic is solved
I modified Joe's XL_Format_HAlign so that it will take whatever cell(s) are selected, instead of having to define the range first: ;------------------------------------------------------------- ExcelActions_HAlign(ByRef XL, RG="", h="2"){ Cell_address = % XL.ActiveCell.Address[1,1] Range_address :=...
- 26 Jul 2020, 08:07
- Forum: Ask For Help
- Topic: Excel-AHK
- Replies: 3
- Views: 1552
Re: Excel-AHK
ComObjActive("Excel.Application").ActiveSheet.Next.Activate ; activate next ComObjActive("Excel.Application").ActiveSheet.Previous.Activate ; activate prev. ComObjActive("Excel.Application").ActiveWorkbook.Worksheets(3).Activate ; activate #3 ComObjActive("Excel.Application").ActiveWorkbook.Workshe...
- 26 Jul 2020, 07:56
- Forum: Ask For Help
- Topic: Excel: insert rectangle
- Replies: 5
- Views: 1660
Re: Excel: insert rectangle
msoShapeRectangle := 1, xlHAlignCenter := -4108, xlVAlignCenter := -4108 xl := ComObjActive("Excel.application") TxtFrm := xl.ActiveSheet.Shapes.AddShape(msoShapeRectangle, 10, 10, 200, 100).TextFrame TxtFrm.Characters.Text := "This is a rectangle" TxtFrm.HorizontalAlignment := xlHAlignCenter TxtFr...
- 24 Apr 2020, 11:12
- Forum: Ask For Help
- Topic: Slicer excel VBA to AHK
- Replies: 5
- Views: 494
Re: Slicer excel VBA to AHK
I didn't test this but I think it should be something like this: /* ActiveWorkbook.SlicerCaches("Slicer_Date.Month3").VisibleSlicerItemsList = _ * Array( _ * "[Date].[Month].&[4]", "[Date].[Month].&[5]") * ActiveWorkbook.SlicerCaches("Slicer_Date.Day_In_Month").VisibleSlicerItemsList _ * = Array( _ ...
- 03 Dec 2019, 22:33
- Forum: Ask For Help
- Topic: Hotkey in Excel stops before finishing
- Replies: 2
- Views: 412
Re: Hotkey in Excel stops before finishing
Hi AbooMatta, Your script is probably sending keystrokes faster than Excel can handle. If one step takes Excel a bit more time to do but your script keeps sending stuff in the meantime then the script will get out of sync with Excel. Maybe try adding Sleeps between some actions to try to improve the...
- 08 Nov 2019, 00:11
- Forum: Ask For Help
- Topic: parsing above with regexmatch instead of below Topic is solved
- Replies: 10
- Views: 1149
Re: parsing above with regexmatch instead of below Topic is solved
Based on the other thread from https://www.autohotkey.com/boards/viewtopic.php?f=76&t=69631 the following should add the 'details' to the match.. it's trivial to just match the previous line. #NoEnv SetBatchLines, -1 nma2 := "nma2" clip := " (Join`r`n zzzzzz xxxxx nma2 X example (not this one) Y exa...
- 03 Nov 2019, 07:28
- Forum: Ask For Help
- Topic: Why Excel Addins is Wrong?
- Replies: 12
- Views: 2015
Re: Why Excel Addins is Wrong?
try to add .Application It looks like it may need to be Application.COMAddIns . No. Wrong. objExcel in the posted code contains an application object. objExcel.Application is the same as Application.Application :facepalm: from time to time people do not understand the differences between AHk vs VBA...
- 28 Sep 2019, 09:03
- Forum: Ask For Help
- Topic: Array of Arrays for MS Excel VBA txt file reading (some different txt format) Topic is solved
- Replies: 18
- Views: 1906
Re: Array of Arrays for MS Excel VBA txt file reading (some different txt format) Topic is solved
Shouldn't it be the column number? Like this:
Code: Select all
tempArray%A_Index%[0] := A_Index
White_Whale wrote: ↑28 Sep 2019, 00:47Code: Select all
RegExReplace(myContent, ".+\r\n",, lineCounts)
Did you change the RegEx to count tabs (columns)?White_Whale wrote: ↑28 Sep 2019, 01:13ah, "lineCounts" should be "columnCounts" but that is not the point here
- 07 Sep 2019, 16:52
- Forum: Ask For Help
- Topic: Handle multiple open Excel files with ComObj Topic is solved
- Replies: 16
- Views: 2274
Re: Handle multiple open Excel files with ComObj Topic is solved
#k:: wb1 := ComObjGet(A_Desktop "\1.xlsx") wb2 := ComObjGet(A_Desktop "\2.xlsx") MsgBox % wb1.ActiveSheet.Range("A1").Text MsgBox % wb2.ActiveSheet.Range("A1").Text last_cell := wb1.Sheets("DE Doc").Range("A:A").SpecialCells(11).row new_cell := wb1.Sheets("DE Doc").Range("A" last_cell+1) new_cell.v...
- 10 Jul 2019, 23:21
- Forum: Ask For Help
- Topic: Quotation Marks and Variables
- Replies: 4
- Views: 736
Re: Quotation Marks and Variables
try
https://www.autohotkey.com/docs/Variables.htm#Intro
Code: Select all
Instruction := "The category is " Category

Code: Select all
MyNumber := 123 MyString := "This is a literal string." CopyOfVar := Var ; Unlike its counterpart in the previous section, percent signs are not used with the := operator.
- 06 Jul 2019, 02:31
- Forum: Offtopic
- Topic: How to find my last post
- Replies: 13
- Views: 2533
- 05 Jul 2019, 23:27
- Forum: Offtopic
- Topic: How to find my last post
- Replies: 13
- Views: 2533
Re: How to find my last post
Here, I found it for you:
https://www.autohotkey.com/boards/memberlist.php?mode=viewprofile&u=79083
as I said before, click "Search user’s posts" on that page
https://www.autohotkey.com/boards/memberlist.php?mode=viewprofile&u=79083
as I said before, click "Search user’s posts" on that page
- 05 Jul 2019, 23:04
- Forum: Offtopic
- Topic: How to find my last post
- Replies: 13
- Views: 2533
Re: How to find my last post
Are you using a weird browser?
Are you using something that blocks content from being shown on webpages?
It's literally at the top of this page.
Are you using something that blocks content from being shown on webpages?
It's literally at the top of this page.
- 05 Jul 2019, 22:42
- Forum: Offtopic
- Topic: How to find my last post
- Replies: 13
- Views: 2533
- 05 Jul 2019, 22:26
- Forum: Offtopic
- Topic: How to find my last post
- Replies: 13
- Views: 2533
- 05 Jul 2019, 20:48
- Forum: Offtopic
- Topic: How to find my last post
- Replies: 13
- Views: 2533
Re: How to find my last post
Go to your profile (top right):
then click "Search user’s posts"
then click "Search user’s posts"
- 05 Jul 2019, 19:55
- Forum: Ask For Help
- Topic: Finding Excel File. Loop, Files Topic is solved
- Replies: 14
- Views: 2408
Re: Finding Excel File. Loop, Files Topic is solved
Try it like this. You need to save A_LoopFileFullPath because it will be blank outside the loop. !q:: inputbox, userinput, Enter Full Project ID, , ,300 ,100 ; If the user pressed cancel or the string is too short if (ErrorLevel || StrLen(userinput) = 0) MsgBox, No file specified ;sleep, 500 FoundFi...
- 01 Jul 2019, 10:54
- Forum: Ask For Help
- Topic: Regex to remove comment lines Topic is solved
- Replies: 6
- Views: 911
- 01 Jul 2019, 10:48
- Forum: Ask For Help
- Topic: Regex to remove comment lines Topic is solved
- Replies: 6
- Views: 911
Re: Regex to remove comment lines Topic is solved
"`am)^\s*;.*(?:\R|$)"