Take the snapshot from any application and paste it in excel file

Hi Team,
How we can take the snapshot from any of the application and paste it in excel. For all the defined user.
I need to take the snapshot for every user from application and paste it in one after other in vertical manner.

Thanks
Riya

Here is my solution:

You take a screenshot with “Take Screenshot” and get that path and pass the param into a python file (use openpyxl)

import sys
from openpyxl import Workbook
from openpyxl.drawing.image import Image

wb = Workbook()
ws = wb.active

image_path = sys.argv[0]

img = Image(image_path)
ws.add_image(img, 'A1')

wb.save("output_with_image.xlsx")


then run cmd or powershell activity UiPath

python script.py par1

For taking a screenshot, you can use take screenshot activity in UiPath and provide the selector of an element to capture desired application screenshot. Then you can either use VBA or VB Script to put it into Excel.

Do you have the vb script?

Thanks,
Riya

Position is not specified.I just need to take the snapshot for all the employees and paster it one after other.

Hi @Riya1

You Can Use Shortcut to insert the Picture.

Try this

  1. Use Excel application scope with Write cell activity and mention the sheet name to add the Pictures.
  2. Use the Send Hotkey in this scope and key as ALT+nzipd (It is for Excel 2021 version, Based on the excel version the shirt key may vary. Press ALT and navigate as per the letter indicated on the Menu bar)
  3. Use Type into Activity and Indicate the Insert image pop-up and pass the Path with the file name and click ok or enter as a shortcut.

Regards,
Gowtham K

Hi @Gowtham_K115 ,

we have different version of excel installed in different BOT machines.Might be send hotkey will not work