Posts: 27
Threads: 9
Joined: Apr 2013
I have been building a number of functions and macros to automate a pretty lengthy quoting process that I have to do day in and day out. I would like to work on it at my home but for some reason the macros won't run at home. The only difference I can figure is that my work machine runs Windows 7 and my home computer runs Windows 8. Any thoughts on why this might be taking place?
The macro will open the quote web address but it won't input the data that needs to be entered into the online quote software. Any thoughts would be great to help!
Best Regards,
Paul Daugs
Posts: 1,338
Threads: 61
Joined: Jul 2006
Maybe window names are not the same.I find it is usually better to use simple window names instead of full window name.It probably is just a few simple tweaks.If using mouse clicks maybe screen resolution is not the same.Hard to say without seeing your code. Try to recapture the windows and see if there is a difference.
Posts: 27
Threads: 9
Joined: Apr 2013
Hello Kevin,
Here is some of the code I am using. The code will open internet explorer but it won't actually follow the "SetValue" instruction and it throws a run time error and macro fails. I try to stay away from mouse click if possible as you said before when people have different screen resolutions they can use the same macro then.
function ARRAY(str)&a [str&s]
web "http://newmanlongtermcare.com/new_agent/toolkit/newman.html" 12 "iexplore - Shortcut"
int w1=wait(6 WV win("https://ltcselect.com/admin.asp - Windows Internet Explorer" "IEFrame"))
wait 5
str date c1 c2
//////////////////////////////////////////////////////////////////////AGENT INFO ENTERED//////////////
/Enter Agent Name
int w=wait(3 WV win("https://ltcselect.com/admin.asp - Windows Internet Explorer" "IEFrame"))
Acc a1.Find(w "TEXT" "" "a:name=User_ContactName" 0x3004 3)
a1.SetValue(F"{a[1]} {a[2]}")
/Click Next
Acc a2.Find(w "PUSHBUTTON" "Next" "" 0x3001 3)
a2.DoDefaultAction
Let me know if you have an genius thoughts on when this isn't working.
Thanks,
Paul Daugs
Posts: 12,140
Threads: 142
Joined: Dec 2002
Try to add flag 1 in web.
For example, this macro often fails:
Macro
Macro2467
web "http://www.quickmacros.com" 12
int w=wait(3 WV win("Internet Explorer" "IEFrame"))
act w
Acc a.Find(w "TEXT" "" "a:name=q" 0x3004 3)
a.SetValue("A")
1
a.Select(1)
key "B"
But does not fail with flag 1:
Macro
Macro2467
web "http://www.quickmacros.com" 12|1
int w=wait(3 WV win("Internet Explorer" "IEFrame"))
act w
Acc a.Find(w "TEXT" "" "a:name=q" 0x3004 3)
a.SetValue("A")
1
a.Select(1)
key "B"
Reason - the new page in new tab is not fully loaded, and a.Find finds the text box object in old page/tab, which now is in background. With flag 1 web waits until fully loaded.