Hi @Dave,
I checked your declarations and added the missing one i.e. "EmptyClipboard".
Declare PtrSafe Function EmptyClipboard Lib "user32" () As Long
Also changed WFormat in both the below declarations from "Integer" to "Long".
Declare PtrSafe Function IsClipboardFormatAvailable Lib "user32" (ByVal wFormat As Long) As Long
Declare PtrSafe Function GetClipboardData Lib "user32" (ByVal wFormat As Long) As LongPtr
and also changed the below from LongPtr to Long:
fPictureOwnsHandle As Long
in
Declare PtrSafe Function OleCreatePictureIndirect Lib "OleAut32.dll" (PicDesc As uPicDesc, _ RefIID As GUID,
ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
The code runs and i can see from the watch window that the dictionary items are populated, but show as "Nothing".
AddPicture error.jpg
i.e. the IPic in OleCreatePictureIndirect is not getting created correctly. Am i missing something?
IPic Error.jpg
How do i add an Image control to a Worksheet? Can you post a working example file demonstrating image control on worksheet?