Puffeltje
2025-05-29T15:48:14Z
At the moment I am trying to fill IGRID7 ActiveX 64bit in VBA with icons. In your example you use the following code:

Set m_objImageList = New CImageList
With m_objImageList
.Create 24, 24, ThisWorkbook.Path & "\Images\"
.AddImage "RedSquare.bmp"
.AddImage "OrangeSquare.bmp"
.AddImage "GreenSquare.bmp"
End With

I do not want to use extra files but store the files in the excel document itself. Is it possible to fill a CImagelist with the content of various image objects?
Igor/10Tec
2025-05-30T15:03:56Z
The CImageList.AddImage method internally uses the LoadImage WinAPI function that works with graphical files stored on hard drives. It's not possible to feed other kinds of bitmap sources into the AddImage method because of this. I do not know whether it is possible to write another version of the AddImage method that can load images directly from Excel sheets.

Perhaps, the fastest and simplest way to implement your task would be reusing of the existing AddImage method. If Excel allows saving its images from sheets to hard drive, you can temporarily save your images on a hard drive in a temp folder during grid initialization and upload them into CImageList by using the existing AddImage method.