Load a picture in a cell from userform.... give me a number iinstead than a photo!

Alex Piotto

Board Regular
Joined
Jul 5, 2016
Messages
82
Office Version
  1. 2007
Platform
  1. Windows
Hi everybody!
I am trying to pass some data and an image from a userform to another sheet.
Everything seems to work fine, all data go in the right place in the other sheet, but instead of the picture, I get a number in the cell!
What am I doing wrong?
Here is the part of code concerned...

Code:
RowCount = Worksheets("RICETTEDATABASE").Range("A1").CurrentRegion.Rows.count


With Worksheets("RICETTEDATABASE").Range("A1")


.Offset(RowCount, 0).Value = Me.txtRicetta.Value
.Offset(RowCount, 1).Value = Me.comboCategoria.Value
.Offset(RowCount, 2).Value = Me.txtAutore.Value
.Offset(RowCount, 3).Value = Replace(Me.txtLista.Value, Chr(13), "")
.Offset(RowCount, 4).Value = Replace(Me.txtPreparazione.Value, Chr(13), "")
.Offset(RowCount, 5).Value = Format(Now, "dd/mm/yyyy")


Dim Pict As String
Pict = Me.fotoAddress.Value
Dim Picto As Long
Picto = LoadPicture(Pict)
If Pict <> "" Then
.Offset(RowCount, 6).Value = Picto                                  'here I get a number... no picture!


Else
Dim picta As Shape
Set picta = Worksheets("Apertura").Shapes("LOGOTIPO")
picta.Copy
.Offset(RowCount, 6).PasteSpecial
End If


End With
Any help will be really appreciated.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top