PDA

View Full Version : Open Webpage use pg dwn, take a screen shot (print screen) and paste into excel



NatstinC
10-25-2015, 08:11 PM
Hi everyone, I am currently using the below code to do the following (in Excel 2013):

-open a specific website to a certain window size and page down to a specified point in the webpage
-take a screen shot set at a specified size and location of the window
-create a chart in a specified excel worksheet (in the current workbook) and paste the screen shot into the chart to size specified.

I started using a very useful code that I found on this forum compiled by Zack Barresse (thank you so much for sharing this Zack it has been a huge help)

As I am relatively new to vba coding and my level of understanding is quite basic in comparison, I have managed to make some changes to the code to fit my needs (of opening a website/page down to a specified place in webpage and pasting into a specified worksheet in the current workbook) however I am a bit stuck on the following:

Num Lock function on keyboard changes: The code I added (not Zack's) appears to change my Numbers Lock functionality (I used a variety of different codes until it basically worked for me - however now it appears to switch my Num Lock function - eg if it is on Num Lock when I run the code, when I finish my keyboard now acts as though Num Lock is not selected (even though it is) and vice versa - I have tried variations to fix this but nothing seems to settle the issue - the code is:


'''####This Code seems to flip NUM LOCK key - how can I return the setting to what it was?
Application.SendKeys "{RIGHT 45}", True
Application.SendKeys "{PGDN 1}{DOWN 1}", True

How can I resize the chart and picture when I paste into excel: I can't quite get this to work for me and the size of the chart always comes out the same - is someone able to point me in the right direction of how to do this?

The full code I am using is attached

Thanks in advance for any assistance : pray2: