Windows screenshot with VBA

Radoslaw Poprawski

Active Member
Joined
Jun 19, 2021
Messages
398
Office Version
  1. 365
Platform
  1. Windows
Hi
I found this article here:
However I do not see the code for application hearts.

My question is this:
How do I Take a screenshot from just 1 sccreen.
How Do i name my screens (monitors?)

Is this code up to date since its from 2013?

I am working on 2 monitors and i need full screen picture of just 1 of them.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Check if the following is what you need:

VBA Code:
Sub Save_Screenshot()
  Dim sh As Worksheet
  Dim archivo As String
  '
  archivo = "C:\ejemplo\pantalla.jpeg"    'folder and file name
  Application.SendKeys "(%{1068})"
  DoEvents
  Set sh = Sheets.Add
  DoEvents
  sh.Shapes.AddChart
  With sh.ChartObjects(1)
      .Height = 500
      .Width = 1000
      .Chart.Paste
      .Chart.Export archivo
  End With
  Application.DisplayAlerts = False
  sh.Delete
  MsgBox "screenshot saved"
End Sub

Example:
 
Upvote 0
Actualy, its close but not quite,
I need to make full screen 1 screenshot with full size,
I work on 2 monitors So I need to take full screenshot of just 1
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,127
Members
452,381
Latest member
Nova88

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