IE Print Screen Not Correct Info

CrashOD

Board Regular
Joined
Feb 5, 2019
Messages
118
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Sub IE_Load_PrintScreen()

' IE and OutLook
Dim NorryLink As String

' Link to copy Print Screen
NorryLink = "Home - County of Northumberland" & Sheets("Tax Cert Bill").Range("B17").Value

Dim IE As Object
Dim hwnd As Long, IECaption As String

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Width = 624
IE.Height = 756

IE.Navigate NorryLink

Wait 10
DoEvents

' ~~> Take a snapshot
Call keybd_event(VK_SNAPSHOT, 1, 0, 0)

Application.SendKeys "(%{1068})"
DoEvents


IE.Quit
Set IE = Nothing

End Sub


this is what it shows that is missing info
1653672033606.png



what it should show

<< image removed due to personal data >>


was working then just stopped. it is taking the data from previous item. load page shows right info but when i past not just shows the ie windows with no other info
 
Last edited by a moderator:

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Application.SendKeys "(%{1068})"
was casing the error that was to be in my e-mail area. thanks so much!
 
Upvote 0
Sub IE_Load_PrintScreen()
' IE and OutLook
Dim NorryLink As String
' Link to copy Print Screen
NorryLink = "Home - County of Northumberland" & Sheets("Tax Cert Bill").Range("B17").Value
Dim IE As Object
Dim hwnd As Long, IECaption As String
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Width = 624
IE.Height = 756
IE.Navigate NorryLink
Wait 10
DoEvents
' ~~> Take a snapshot
Call keybd_event(VK_SNAPSHOT, 1, 0, 0)
' Application.SendKeys "(%{1068})"
DoEvents

IE.Quit
Set IE = Nothing
End Sub
this is what it shows that is missing info

1653672033606.png


what it should show
<< image removed due to personal data >>
was working then just stopped. it is taking the data from previous item. load page shows right info but when i past not just shows the ie windows with no other info

Still has the issue of Printscreen only getting browser windows but no data in the browser. any help would be great!
 
Upvote 0
I would highly recommend changing your development plan, as Internet Explorer is coming to "end of life" in exactly 2 weeks.

Microsoft replaced IE with Edge.
 
Upvote 0
I would highly recommend changing your development plan, as Internet Explorer is coming to "end of life" in exactly 2 weeks.

Microsoft replaced IE with Edge.
how would i get it to use edge then? also are terminal server does not have edge installed. but we have chrome and fire fox installed. I use chrome for most things on monitor 1. the firefox on monitor 2. fire fox is slower.
 
Upvote 0
I do not do any interaction with browsers and VBA (especially not "Send Keys"). So I cannot provide much guidance there.
I just wanted to make sure that you didn't end up wasting your time building an application that will be obsolete in two weeks!
 
Upvote 0
' Wait Code to wait in seconds
Private Sub Wait(ByVal nSec As Long)
nSec = nSec + Timer
While nSec > Timer
DoEvents
Wend
End Sub

Sub OpenInChromeOrDefaultBrowser()
Dim NorryLink As String ' if change this change it every were you see NorryLink

' Link to copy Print Screen
NorryLink = "https://tax.norrycopa.net/taxclaim/trirsp2pp.asp?parcel=" & Sheets("Tax Cert Bill").Range("B17").Value ' to determin link to go to

Dim wholeContent As String
chrome = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

If Dir(chrome, vbNormal) <> "" Then
'' 32 bit Chrome
wholeContent = """" & chrome & """ -url " & NorryLink
Else
'' 64 bit Chrome
chrome = "C:\Program Files\Google\Chrome\Application\chrome.exe"
wholeContent = """" & chrome & """ -url " & NorryLink
End If

If Dir(chrome, vbNormal) <> "" Then
'' Chrome is found, execute
Shell wholeContent
Else
'' Chrome was not found, open url using the default program
Dim Sh As Object
Set Sh = CreateObject("WScript.Shell")
Sh.Run NorryLink
End If

Wait 3 ' seconads to wait before screenshot
DoEvents

' ~~> Take a snapshot
Call keybd_event(VK_SNAPSHOT, 1, 0, 0)


DoEvents

End Sub
 
Upvote 0
Solution
I do not do any interaction with browsers and VBA (especially not "Send Keys"). So I cannot provide much guidance there.
I just wanted to make sure that you didn't end up wasting your time building an application that will be obsolete in two weeks!
thanks so much. found out not hard to have it open Chrome. had to modified code but seems to work. If i knew how to screen shot with out send keys and past in vba i would use that. heck i would love to get it that browser would not have to open but all the code i seen for that only takes tables. but your advise had let me in a direction i was wonting to do. I did not have to install Selinium eather to use chrome.

Thank You!
 
Upvote 0
You are welcome.
I am glad you were able to figure something out.
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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