xainthowell
New Member
- Joined
- Mar 3, 2023
- Messages
- 24
- Office Version
- 2013
- Platform
- Windows
can someone help me with this error. Thanks
form_SSEN.xlsb | ||||
---|---|---|---|---|
AK | AL | |||
1 | PHOTO | SIGNATURE | ||
2 | ||||
Data |
VBA Code:
Private Sub cmdPhoto_Click()
On Error Resume Next
Dim imagepath As String
imagepath = Application.GetOpenFilename(filefilter:="Picture files,*.gif;*jpg;*jpeg;*.png", Title:="Add Picture")
If imagepath <> False Then
Me.imgPhoto.Picture = LoadPicture(imagepath)
Me.imgPhoto.Visible = True
End If
End Sub
Private Sub cmdSave_Click()
Dim LastRow As Long
Dim PicPath As String
namepic = Sheet2.Range("B2").Text
SavePicture imgPhoto.Picture, ThisWorkbook.Path & "\" & namepic & ".jpg"
PicPath = ThisWorkbook.Path & "\" & namepic & ".jpg"
Data.Cells(LastRow, "AK").Value = PicPath
ThisWorkbook.Save
MsgBox "Data Saved", vbInformation
End Sub