AppActivet for inactive webpage.

MatteOlof

New Member
Joined
Mar 5, 2019
Messages
2
Hi, my Webpage is not active when i run this macro, Sendkeyps UP hapens in excel, is there a way to make the web paga active, like AppActive?
I cant get AppActive to work befor the sendkeys command.
The funny thing is that the macro works IF i open VBA befor i run it..

Sub automatic_order()

Set IE = CreateObject("InternetExplorer.Application")
IE.navigate ActiveCell.Offset(0, 20).Value
IE.Visible = True
Do While IE.Busy Or IE.ReadyState <> 4
DoEvents
Loop



If ActiveCell.Offset(0, 4).Value = "Köp" Then

IE.Document.getElementsByName("validUntil")(0).Value = ActiveCell.Offset(0, 19).Value
IE.Document.getElementById("volume").Value = ActiveCell.Offset(0, 0).Value
IE.Document.getElementById("price").Value = ActiveCell.Offset(0, 1).Value
IE.Document.getElementById("price").Select
SendKeys "{UP}", True
Sleep 2000
IE.Document.getElementsByClassName("putorder buy buyBtn")(0).Click
Sleep 1000
IE.Quit
Set IE = Nothing
Else
IE.Document.getElementsByName("validUntil")(0).Value = ActiveCell.Offset(0, 19).Value
IE.Document.getElementById("volume").Value = ActiveCell.Offset(0, 0).Value
IE.Document.getElementById("price").Value = ActiveCell.Offset(0, 1).Value
IE.Document.getElementById("price").Select
SendKeys "{UP}", True
Sleep 2000
IE.Document.getElementsByClassName("noMarginRight putorder sell sellBtn")(0).Click
Sleep 1000
IE.Quit
Set IE = Nothing
End If
End Sub
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,939
Messages
6,175,531
Members
452,651
Latest member
wordsearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top