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.
Main.xaml (56.3 KB)
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
-
paste below code to txt file e.g. VBA.txt
-
in excel application scope, call vba function using vba.txt
-
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
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.