Search found 80 matches
- 09 Jan 2021, 11:27
- Forum: Ask for Help (v1)
- Topic: Interacting 'headless' with MS Windows pop-ups
- Replies: 0
- Views: 291
Interacting 'headless' with MS Windows pop-ups
I have an automation in python/selenium with Firefox that executes 'headless' However this website (for login authentication purposes) launches a few MS Windows popups requesting userid/pwd etc. It means my program lands outside the browser context and thus cannot be addressed with selenium. Actuall...
- 28 Jan 2020, 03:50
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
Thanks swagfag for your time. I understand your point. Conclusion: it is easier to have the try/catch blocks inside the code. Regarding the contradiction would appreciate if you develop. At the moment the code exit if call ok ok and repeat if necessary. Have logged in file the (error) and (!error) s...
- 27 Jan 2020, 14:39
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
The param is the result (return value) of a COM interface call. UpdateCell(X1) would pass the interface pointer. It performs the COM Interface calls without ByRef but nothing changes. Still the sleep are necessary or it fails. This is the least amount of sleep it succeeded all the way through other...
- 27 Jan 2020, 06:24
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
UpdateCell(X1.Sheets("Sheet2").Range("C" My_Index).Select) Again, this will perform the COM interface call an pass the result to the function UpdateCell() . No. Since the parameter is passed byRef the parameter is a reference or pointer to the COM Interface call that is executed inside the function...
- 27 Jan 2020, 06:02
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
I expect the function to perform the COM Interface call sent as parameter. This COM Interface call will just highlight the cell: UpdateCell(X1.Sheets("Sheet2").Range("C" My_Index).Select) [Don't care about the function name. I've been reducing the script more and more to circle in the issue, the nam...
- 27 Jan 2020, 02:54
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
Yes, sure, no problem. This script executes in a few sec never fails, have now tested 20 times. X1 := ComObjCreate(("Excel.Application")) X1.Workbooks.Open("C:\Users\aircooled\Private\My_Book.xlsx") X1.Visible:=True My_Index := 1 Loop, 1000 { loop { try (X1.Sheets("Sheet2").Range("C" My_Index).Selec...
- 26 Jan 2020, 16:36
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
Thanks for your response. At this point when we don't know what version of Excel you and I are using, or AHK version, or OS or other parameters I find a little too early to agree with your conclusion. I appreciate your effort, thank you for your time. Now I would gladly like to hear a third opinion ...
- 26 Jan 2020, 10:53
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
If this exact code: Xl := ComObjActive("Excel.Application") Loop, 70 { Random, VAR1, 1, 100 Random, VAR2, 1, 100 TTL := Add(VAR1, VAR2) xl.range("A" a_index).value := Var1 xl.range("B" a_index).value := Var2 xl.range("C" a_index).value := TTL } return Add(x, y){ return x + y ; "Return" expects an e...
- 25 Jan 2020, 16:25
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
Here are my findings. First I implement a very simple function in an external file and perform a simple addition. It executes fast and without errors so that rules out external function per se as the culprit in the errors I get: External function: Add(x, y) { return x + y ; "Return" expects an expre...
- 25 Jan 2020, 06:15
- Forum: Ask for Help (v1)
- Topic: Extracting data from Multiple line clipboard
- Replies: 4
- Views: 1241
Re: Extracting data from Multiple line clipboard
FileAppend, %Clipboard%, %My_Temp_File% FileReadLine, LINE1, %My_Temp_File%, 1 FileReadLine, LINE2, %My_Temp_File%, 2 LINE2 := Mid(%LINE2%,2,4) FileReadLine, LINE12, %My_Temp_File%, 12 FileDelete, %My_Temp_File% FileAppend creates My_Temp_File if it is not already created. Not sure if you need %. Pr...
- 25 Jan 2020, 06:09
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
Yes I have tried to remove the sleeps and then the error is trigged. The error pops up when too many COM Interface calls are done in too short period of time. Also it doesn't matter if I have sleep in the code AND in the external file. What counts is the total amount of sleep before a transaction or...
- 25 Jan 2020, 04:28
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Re: Function in external file with try/catch/Com Interface MUCH SLOWER
Hi Xeo786 nad thanks for your proposal. At the moment I am testing with a fresh Excel sheet with no formulas on it only one sheet with a manually inserted index 1....50 in A1:A50 and some random numbers B1:B50 This is just to prove that the issue is not from the Excel being heavy. I will study and t...
- 24 Jan 2020, 11:45
- Forum: Ask for Help (v1)
- Topic: Function in external file with try/catch/Com Interface MUCH SLOWER
- Replies: 22
- Views: 3208
Function in external file with try/catch/Com Interface MUCH SLOWER
I had problems with a series of COM Interface calls. They trigged an error: "Error: 0x80010001 - Call was rejected by callee" which I worked around by inserting ridiculously large delays between transactions, up to 1200-1500ms. So try/catch for each and every Excel COM Interface was implemented in t...
- 24 Jan 2020, 10:19
- Forum: Ask for Help (v1)
- Topic: Writing a try/catch statement in ONE (1) line
- Replies: 10
- Views: 1832
Re: Writing a try/catch statement in ONE (1) line
Ok, thanks.
One last question. Observing at the try block above:
Code: Select all
try (X1.Range("A1").Value := "=ROW()", error:=0)
- 23 Jan 2020, 02:43
- Forum: Ask for Help (v1)
- Topic: Writing a try/catch statement in ONE (1) line
- Replies: 10
- Views: 1832
Re: Writing a try/catch statement in ONE (1) line
Can anyone On Topic tip on how to write a series of commands in one (1) line like it can be done in other programming languages. It's important (don't know if it makes a difference) that it includes a try/catch of a COM Interface call, for example: loop { try (X1.Range("A1").Value := "=ROW()", error...
- 22 Jan 2020, 18:11
- Forum: Ask for Help (v1)
- Topic: Writing a try/catch statement in ONE (1) line
- Replies: 10
- Views: 1832
Re: Writing a try/catch statement in ONE (1) line
u can chain functions with a comma a(), b(), c() (not recommended) u can chain some commands, legacy IfEqual (super not recommended) u cant chain keywords also i dont understand ur construct, ure misusing the concept of try/catch: loop { try (X1.Range("A1").Value := "=ROW()", error:=0) catch error ...
- 22 Jan 2020, 12:37
- Forum: Ask for Help (v1)
- Topic: Writing a try/catch statement in ONE (1) line
- Replies: 10
- Views: 1832
Re: Writing a try/catch statement in ONE (1) line
https://www.autohotkey.com/docs/commands/Try.htm I think closest you could do is a function that does a try/catch inside. OK, yeah, that could be an option. But the question I wish to anwer now is can the above or any group of commands be written in one line, semicolon separated or whatever? This c...
- 22 Jan 2020, 11:13
- Forum: Ask for Help (v1)
- Topic: Writing a try/catch statement in ONE (1) line
- Replies: 10
- Views: 1832
Writing a try/catch statement in ONE (1) line
Is it possible to write this statement in a single line? Don't ask me why, I just want to do it. I am thinking of semi colon separated, or colon, or comma or something else. Everything in a single line: loop { try (X1.Range("A1").Value := "=ROW()", error:=0) catch error sleep 10 if (!error) break }
- 21 Jan 2020, 09:58
- Forum: Pulovers Macro Creator
- Topic: try/catch in COM Interface calls not working in PMC (workaround)
- Replies: 1
- Views: 2395
try/catch in COM Interface calls not working in PMC (workaround)
This scenario involves several COM Interface Excel calls that were a little tricky to solve. I have solved it and it works but the solution is not so straight forward. I would like to know if the COM Interface editor in Pulover Macro Creator can be setup to avoid this situation. I have a loop that c...
- 19 Jan 2020, 12:57
- Forum: Ask for Help (v1)
- Topic: COM Interface calls to Excel fail randomly. Try?
- Replies: 7
- Views: 1087
Re: COM Interface calls to Excel fail randomly. Try?
Problem solved. Was a little tricky. Autohotkey can in the normal case handle outer A_Index and inner A_Index, for example: loop { X1.Sheets("Sheet 1").Range( "A" . A_Index ).Copy loop { X1.Sheets("Sheet 1").Range( "B" . A_Index ).Select } } This worked beatifully in my old code without try catch. A...