

January 10, 2020

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?


Trusted Members

December 20, 2019

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


January 10, 2020

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


Trusted Members

December 20, 2019

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


January 10, 2020

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.



Trusted Members

December 20, 2019

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.


Trusted Members

December 20, 2019

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


Trusted Members

December 20, 2019



Trusted Members

December 20, 2019

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
1 Guest(s)
