No, I guess I didn't explain it properly. That's what I thought was going on, when I tested it at the customer's site, and when I started the thread.
What's actually happening is I'm loading the image from an OLE object field into a Ribbon Command Button. The button initialization callback routine getImage retrieves the image from a table, and returns it to the getImage routine, using this code:
Public Function getIconFromTable(strFilename As String) As Picture
Dim LSize&, arrBin() As Byte, rst As DAO.Recordset
Set rst = DBEngine(0)(0).OpenRecordset("tblBinary", dbOpenSnapshot)
With rst
.FindFirst "[FileName]='" & strFilename & "'"
If .NoMatch Then Stop ' Programátorská chyba, nemělo by se stát.
LSize = .Fields("binary").FieldSize - 1
ReDim arrBin(LSize)
arrBin = .Fields("binary")
Set getIconFromTable = ArrayToPicture(arrBin)
.Close
End With
Set rst = Nothing
End Function
The function ArrayToPicture is what I'm using to convert the OLE object to its usable form for a button icon.