mattieflo
asked on
IE 7 problems with MS Excel Macros, Javascript form
Hello,
Our department uses Excel Macros in IE 6 to take information off a spreadsheet and enter it on a Javascript form. It works fine, but however when some of our computers got upgraded to IE 7, the macro's timing somehow was throw off. I've tried to insert pause breaks in between commands in VBA, but that doesn't seem to help. Adding RAM to those computers also did not help any. Would any of you folks have any idea on how to start with this?
Many thanks!
Our department uses Excel Macros in IE 6 to take information off a spreadsheet and enter it on a Javascript form. It works fine, but however when some of our computers got upgraded to IE 7, the macro's timing somehow was throw off. I've tried to insert pause breaks in between commands in VBA, but that doesn't seem to help. Adding RAM to those computers also did not help any. Would any of you folks have any idea on how to start with this?
Many thanks!
It really would help to see some more information, perhaps even the code.
I don't see how the form being 'javascript' affecting things.
What mmethods are you currently using to wait?
When you say you are using 'Excel Macros in IE6' do you mean you have code in Excel that is automating IE, taking data from a spreadsheet, entering that in the form etc
I don't see how the form being 'javascript' affecting things.
What mmethods are you currently using to wait?
When you say you are using 'Excel Macros in IE6' do you mean you have code in Excel that is automating IE, taking data from a spreadsheet, entering that in the form etc
ASKER
Ok guys here's sample code. Also I realize I maybe using incorrect terminology just like 'javascript forms' so just bear with me and i'll do my best to describe it.
So the user has an Excel spreadsheet, highlights some information on the spreadsheet and then hits a button to run a macro. The following code is one of those macros.
Sub tag_order()
Dim OriginalRow As Integer
Dim OriginalCol As Integer
Dim NumAreas As Integer
Dim NumRowsInSelection As Integer
Dim i As Integer
Dim j As Integer
Dim k
Dim single_row As Range
Dim single_column As Range
OriginalRow = ActiveCell.row
OriginalCol = ActiveCell.Column
NumAreas = Selection.Areas.Count
AppActivate "Retek - prd"
Send_Keys_Then_Wait "{tab}{tab}{tab}{tab}{tab} {tab}{tab} {tab}"
Send_Keys_Then_Wait "553213261" & "{tab}{tab}"
Send_Keys_Then_Wait "CO" & "{tab}"
Send_Keys_Then_Wait "78" & "{tab}{tab}{tab}{tab}{tab} {tab}"
Send_Keys_Then_Wait Selection.Rows(1).EntireRo w.Cells(19 ).Text, 0, 1
Send_Keys_Then_Wait "{tab}"
Send_Keys_Then_Wait Selection.Rows(1).EntireRo w.Cells(20 ).Text, 0, 1
Send_Keys_Then_Wait "%{t}", 0, 1
Send_Keys_Then_Wait "{down}{down}", 0, 1
Send_Keys_Then_Wait "{enter}", 0, 1
Send_Keys_Then_Wait "16", 0, 1
Send_Keys_Then_Wait "%{o}", 0, 1
Send_Keys_Then_Wait "{tab}{tab}{tab}{tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}"
Send_Keys_Then_Wait "MN" & "{tab}"
Send_Keys_Then_Wait "%{i}", 0, 1
Send_Keys_Then_Wait "%{b}", 0, 1
Send_Keys_Then_Wait "{tab}{tab}{tab}{tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} {tab}{tab} "
Send_Keys_Then_Wait " ", 0, 1
Send_Keys_Then_Wait "%{f}" & "%{p}", 0, 1
End Sub
-------------------------- ---------- ---------- ---------- ---------- ---------- ----
Public Sub Send_Keys_Then_Wait( _
str, Optional seconds_before = 0, Optional seconds_after = 0)
If seconds_before >= 0 Then WaitTime seconds_before
SendKeys str, True
If seconds_after >= 0 Then WaitTime seconds_after
End Sub
-------------------------- ---------- ---------- ---------- ---------- ---------- -------
Retek - PRD is a Oracle form that opens up in a web browser. When we ran this macro in IE6, it ran perfectly. As soon as we upgraded to IE7, it threw the timing off these macros off where they break down and send key strokes in the wrong boxes. Do you guys know what things to look for that could have caused that timing issue?
So the user has an Excel spreadsheet, highlights some information on the spreadsheet and then hits a button to run a macro. The following code is one of those macros.
Sub tag_order()
Dim OriginalRow As Integer
Dim OriginalCol As Integer
Dim NumAreas As Integer
Dim NumRowsInSelection As Integer
Dim i As Integer
Dim j As Integer
Dim k
Dim single_row As Range
Dim single_column As Range
OriginalRow = ActiveCell.row
OriginalCol = ActiveCell.Column
NumAreas = Selection.Areas.Count
AppActivate "Retek - prd"
Send_Keys_Then_Wait "{tab}{tab}{tab}{tab}{tab}
Send_Keys_Then_Wait "553213261" & "{tab}{tab}"
Send_Keys_Then_Wait "CO" & "{tab}"
Send_Keys_Then_Wait "78" & "{tab}{tab}{tab}{tab}{tab}
Send_Keys_Then_Wait Selection.Rows(1).EntireRo
Send_Keys_Then_Wait "{tab}"
Send_Keys_Then_Wait Selection.Rows(1).EntireRo
Send_Keys_Then_Wait "%{t}", 0, 1
Send_Keys_Then_Wait "{down}{down}", 0, 1
Send_Keys_Then_Wait "{enter}", 0, 1
Send_Keys_Then_Wait "16", 0, 1
Send_Keys_Then_Wait "%{o}", 0, 1
Send_Keys_Then_Wait "{tab}{tab}{tab}{tab}{tab}
Send_Keys_Then_Wait "MN" & "{tab}"
Send_Keys_Then_Wait "%{i}", 0, 1
Send_Keys_Then_Wait "%{b}", 0, 1
Send_Keys_Then_Wait "{tab}{tab}{tab}{tab}{tab}
Send_Keys_Then_Wait " ", 0, 1
Send_Keys_Then_Wait "%{f}" & "%{p}", 0, 1
End Sub
--------------------------
Public Sub Send_Keys_Then_Wait( _
str, Optional seconds_before = 0, Optional seconds_after = 0)
If seconds_before >= 0 Then WaitTime seconds_before
SendKeys str, True
If seconds_after >= 0 Then WaitTime seconds_after
End Sub
--------------------------
Retek - PRD is a Oracle form that opens up in a web browser. When we ran this macro in IE6, it ran perfectly. As soon as we upgraded to IE7, it threw the timing off these macros off where they break down and send key strokes in the wrong boxes. Do you guys know what things to look for that could have caused that timing issue?
I think if you search here, and probably anywhere else, you'll find that using SendKeys is not the best way of doing this sort of thing.
I would almost go as far as to say it's the worst but I do know that that method is needed sometimes.
Can you open this form/webpage/whatever in IE7/8 using a hyperlink or some other method?
Or are you working with an existing instance of it?
I would almost go as far as to say it's the worst but I do know that that method is needed sometimes.
Can you open this form/webpage/whatever in IE7/8 using a hyperlink or some other method?
Or are you working with an existing instance of it?
ASKER
Correct, the form in IE 7 is already open when this macro button is pressed.
Let me ask, what other alternative exists other than SendKeys?
Let me ask, what other alternative exists other than SendKeys?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks I think that's what im looking for, i'll give it a shot.
Hello mattieflo:
Did above code help you?
Did above code help you?
It would be easier to help with some additional details like which website, size of data, macro code etc.