Image Dimensions in Excel Cell Problem

Inserted image in excel cell is too big in comparison to the size of cell in excel sheet. I don’t know how to do automation in such a way that the proposed image properly fits in the cell. Kindly help me with this automation.
image
Main.xaml (56.3 KB)

Hi @Akanksha_Gaur

after taking screenshot you can resize the image.
below post has a workflow for that

hope this is helpful

Hello @Akanksha_Gaur

If you have the provision to use the custom packages then you can go with the below activity.
It is providing Insert Picture into Cell activity, which can meet your requirement.

1 Like
  1. paste below code to txt file e.g. VBA.txt

  2. in excel application scope, call vba function using vba.txt
    image

  3. the entryMethodParameters are as follows
    {"sheetName", "imagePath", "cellAddress", widthOfImage(Integer), heightOfImage(Integer)}
    Example
    {"Sheet1", "C:\Users\jackc\Downloads\Capture.png", "A5", 100, 100}

Function InsertImageToSheet(sheetName As String, imgPath As String, cellAddress As String, width As Integer, height As Integer)
    Application.DisplayAlerts = False
    Dim ws As Worksheet
    Set ws = ActiveWorkbook.Sheets(sheetName)
    ws.Activate
    Dim img As Object
    Set img = ActiveSheet.Shapes.AddPicture(imgPath, LinkToFile:=False, SaveWithDocument:=True, Left:=ActiveSheet.Range(cellAddress).Left, Top:=ActiveSheet.Range(cellAddress).Top, width:=width, height:=height)
    ActiveWorkbook.Save
    Application.DisplayAlerts = True

End Function

use this version instead @Akanksha_Gaur

VBA.txt (568 Bytes)
Main (1).xaml (50.9 KB)


please resed me main.xaml file

are your packages updated?
image

here,

Main (1).xaml (50.9 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.