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?
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
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
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
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.
Mohith
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:ScreenDumpMonday" (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.
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.
You will need to type in the proper file path for the save location - something like "C:ScreenDumpMonday" (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.
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
Thank you very much. I got what I had thought.
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.
Strange seems to work for me (well every other time)
Try it with excel maximised to fill the whole screen
Tried doing the same. No changes.
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
Hello Purfleet,
Trust you are doing well.
Thanks for the support on building this excel file.
Request your kind support on this topic again, recently our system was upgraded to Windows 11 due to which the current excel file is having some error which we could not figure it out.
Could you please check and support on this.
BR,
Mohith
Hello All,
Can anybody else resolve this?