ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   when setting Imagelist for ImageCombot, Excel crash (https://www.excelbanter.com/excel-programming/333423-when-setting-imagelist-imagecombot-excel-crash.html)

Arnaud

when setting Imagelist for ImageCombot, Excel crash
 
Step to reproduce :
- launch excel (2003 in my case)
- insert an imageList (MSComctlLib.ImageListCtrl.2)
- add 1 picture in it : properties-Custom-Images-Insert Pictures
with index : 1 and key : "aa"
- insert an imageCombot (MSComctlLib.ImageComboCtl.2)
- insert a button
- add the following code to the button :
Private Sub CommandButton1_Click()
Sheet1.ImageCombo1.ImageList = Sheet1.ImageList1
Sheet1.ImageCombo1.ComboItems.Add 1, "aa", "captionaa", "aa"
Sheet1.ImageCombo1.ComboItems.Add 2, "bb", "captionbb", "bb"
End Sub

save your work
-- if you close sheet all is ok
-- if you push button (= if you execute the vba code) and you close sheet
excel crashes

- execute code by pusshing the

I have found this very similar support but it doens't speak about crash :
http://support.microsoft.com/?kbid=194910

What I have done wrong ?


Ivan F Moala[_60_]

when setting Imagelist for ImageCombot, Excel crash
 

The only way I have over come this is to set your combobox @ design tim
and not run time.

Also once set, images etc , don't go back and try altering images etc
I have experienced crashes on close down when doing this

--
Ivan F Moal

-----------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...nfo&userid=195
View this thread: http://www.excelforum.com/showthread.php?threadid=38393



All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com