Results 1 to 20 of 32

Thread: A Class Module to store Images from a folder for later reuse in Workbook Excel VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    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?
    Last edited by sifar786; 02-19-2020 at 12:27 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •