I found a bit of code that helps insert a picture to a worksheet, but the user has to choose which picture is inserted. I was hoping that it would, instead, choose a specific picture (specifically the company logo) and insert it. Here’s the code:
PicLocation = Application.GetSaveAsFilename("C:\Work\test_Project\", "CA_Value_AVM, *.jpg", 1)
If PicLocation <> "" Then
ActiveSheet.Pictures.Insert(PicLocation).Select
Else
Exit Sub
End If
This code is executed when a button is clicked. The user clicks it and then the path “C:\Work\test_Project\” is opened and the user has to click the picture. I need this to change so that the user doesn’t click anything.
It should work as:
as that’s all the function is returning anyway.