• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Auto screen shot|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Auto screen shot|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Auto screen shot
sp_PrintTopic sp_TopicIcon
Auto screen shot
Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
1
January 11, 2020 - 1:53 pm
sp_Permalink sp_Print

Hi,
Required suggestion on this.

Once the command in excel is given , the excel should be minimized and the screen shot of the desktop has to be taken, the image of the screen shot has to be saved in a folder with file name from a cell in the excel and the link of the image should be available in another file.
Is this possible?

Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
2
January 12, 2020 - 12:23 am
sp_Permalink sp_Print

Hi Mohith

Please see attched - i actually wasnt as hard as i thought once i got to grips with the objects and shapes. It could be improved and it certainly isnt perfect but might give you a start.

Cells A1 to A4 are where you want the output saved, the file name, date and time (to make the picture name unique) and then the file extension.

I have tested in Excel  365 and 2016

Let me know if it was what you were after

Purfleet

Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
3
January 12, 2020 - 9:54 pm
sp_Permalink sp_Print

Hello Purfleet,

Thank you very much for the support.

It is working, but i could not prepare the file as i wished for. Request your support again.

Please find the attached file where i have drafted the format which is required. Column A will be the date, Column B will be the file name (input will be given by the user), Column C should be the file location (Documents folder). The command test report is the run key (this is common for all the reports).

Thanks for your kind support in advance.

 

Thanks,

Mohith

Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
4
January 13, 2020 - 6:49 am
sp_Permalink sp_Print

Hi Mohith

Updated macro using b2 as the file name with A2 also appended and the .jpeg is hardcoded - so the file name will be '1330123456 12012020.jpg'. This does mean that running the macro more than once per day will overwrite the previous screen dump.

I couldn’t workout what the list of dates and work orders were for, so only the top one is used for saving.

I have also noted the code to say what each part is doing, so you could be able to change the variables fairly easy

Purfleet

Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
5
January 13, 2020 - 3:05 pm
sp_Permalink sp_Print

Hello Purfleet,

Good Day!

Thanks for the updated macro.

The file will be updated with approximately 50 inputs in column B in a day. All these values will be with unique numbers. The dump should not be overwritten but should be saved with file name from cell B every time the input is given in column B.

Also i changed the location to Documents and i got run time error. The screen shot captured from the macro was of the excel sheet and not the desktop. Once the excel is minimized, there will be another screen of the test  which has to be captured and saved.

Sorry if I am troubling you with lot of confusing inputs from my side :-).

Thanks again for your continued support on this topic.

MohithFail-report.JPGImage Enlarger

Fail-report1.JPGImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage Fail-report.JPG (21 KB)
  • sp_PlupImage Fail-report1.JPG (18 KB)
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
6
January 14, 2020 - 10:35 pm
sp_Permalink sp_Print

Morning

1 - The file will be updated with approximately 50 inputs in column B in a day. All these values will be with unique numbers. The dump should not be overwritten but should be saved with file name from cell B every time the input is given in column B.

So you want the last cell on column B to be the file name?

2 - Also i changed the location to Documents and i got run time error. The screen shot captured from the macro was of the excel sheet and not the desktop. Once the excel is minimized, there will be another screen of the test  which has to be captured and saved.

You will need to type in the proper file path for the save location - something like "C:\ScreenDump\Monday\" (it must end with a backslash)

You will also need to minimise all other windows manually as it doesn't seem possible to minimise all windows with VBA

The macro is far from perfect and will need tweaking as a lot of this code is using workarounds for a specific purpose.

Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
7
January 16, 2020 - 1:19 pm
sp_Permalink sp_Print

Hello Purfleet, Good morning!

So you want the last cell on column B to be the file name?

Yes, the last input in the column B should be the file name.

Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
8
January 16, 2020 - 1:26 pm
sp_Permalink sp_Print

You will need to type in the proper file path for the save location - something like "C:\ScreenDump\Monday\" (it must end with a backslash)

Sorry i didn't show the path for the save location in my last reply. Please find the path which i have given and the error code.Capture.JPGImage Enlarger

 

sp_PlupAttachments Attachments
  • sp_PlupImage Capture.JPG (78 KB)
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
9
January 17, 2020 - 6:31 am
sp_Permalink sp_Print

That error is not the path, but the dodgy process we are doing for the screen dump.

It works on the Visual Basic editor is open but not if closed! I have no idea why

I have change arround a bit of code and now it seems to work without the VBE open, but now only works every other press!

Will try and test some more over the weekend

Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
10
January 17, 2020 - 1:04 pm
sp_Permalink sp_Print

Thank you very much. I got what I had thought. 1234-17012020.jpgImage Enlarger

One observation now is that the screenshot is captured immediately and it is capturing during minimizing of excel. Please have a look when you find time for this.

Thank you Purfleet again for your wonderful support.111-17012020.jpgImage Enlarger

 

sp_PlupAttachments Attachments
  • sp_PlupImage 111-17012020.jpg (54 KB)
  • sp_PlupImage 1234-17012020.jpg (63 KB)
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
11
January 18, 2020 - 1:35 am
sp_Permalink sp_Print sp_EditHistory

Strange seems to work for me (well every other time)

Try it with excel maximised to fill the whole screen

Avatar
Mohith M Y
Member
Members
Level 0
Forum Posts: 17
Member Since:
January 10, 2020
sp_UserOfflineSmall Offline
12
January 20, 2020 - 1:09 pm
sp_Permalink sp_Print

Tried doing the same. No changes.5678-20012020.jpgImage Enlarger

1234-20012020.jpgImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage 5678-20012020.jpg (52 KB)
  • sp_PlupImage 1234-20012020.jpg (51 KB)
Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
13
January 20, 2020 - 4:32 pm
sp_Permalink sp_Print

Strange worked for me on my laptop and desktop. Maybe it is because you have multiple Excel sessions open.

Dont forget that what we are doing here is something that Excel is not designed for and everything is a work around

You are best off trying different things to see what works

Purfleet

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Alain Balken, David du Toit
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Karen Newman
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27830

 

Member Stats:
Guest Posters: 49
Members: 32347
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.