Am having issues with a get window function, it isn't finding the window and just ends up taking which ever window is in view.

I need it to find the actual window with the IE caption, take a print screen of it, close the window then paste into Excel.

The code works when you play from VBA but when attached to a button it fails to act correctly as mentioned above.

I have tried with the button to have the whole code behind it, and also where it does a call against the code which is listed below. - it has two get IE captions because when the URL that is used loads it has one name and launches a smartcard application which is why escape is used and then the IE caption changes.

Please Login or Register  to view this content.