Good afternoon!
I'm using the code below to put load images in the excel of certain directory plus my formula is experiencing error
Followthecode:
PublicFunctiongetImage(ByValsCodeAsString)AsStringDimsFileAsStringDimoSheetAsWorksheetDimoSellAsRangeDimoImageAsShapeSetoCell=Application.CallerSetoSheet=oCell.ParentSetoImage=NothingFori=1TooSheet.Shapes.CountIfoSheet.Shapes(i).Name=sCodeThenSetoImage=oSheet.Shapes(i)ExitForEndIfNextiIfoImageIsNothingThensFile="C:\Temp\Nova pasta" & sCode & ".jpg"
Set oImage = oSheet.Shapes.AddPictute(sFille, msoCTrue, oCell.Left, oCell.Top, oCell.Width, oCell.Height)
oImage.Name = sCode
Else
With oImage
.Left = oCell.Left
.Top = oCell.Top
.Width = oCell.Width
.Height = oCell.Height
End With
End If
getImage = ""
End Function
Could anyone help me identify the error of this formula?