The title says it all. I want to distribute an Excel file that can automatically add a commandbar and button, and I'd like to provide a custom icon for the button. At this point I would simply like to have a const or array hardcoded in my module with picture data in it. After creating the commandbar and commandbarbutton, use the bytes for the .Picture property.
I could save the bytes to a temp file, then use LoadPicture() but this seems sloppy. How do I skip the saving-to-disk step? I am sincerely hoping I don't have to create a device context and such, and draw the dang thing using various API calls, since I have almost no experience with Windows API graphics and it's just a single silly picture load I am hoping to get done quickly!
I looked at GetObjectAPI but the bmBits property is returning a 0.
In order to do this task I also need to know how to retrieve the bits I've already loaded into the button's picture. I suppose I could just save a .bmp and use those raw bytes, which is fine, but I'd like the luxury of being able to display the bytes for commandbarbutton pictures without the intermediate step of saving them to a file. Plus, I'm interested to know how this all works. Perhaps I'll get into Windows graphics by bits and pieces...
Erik
PS This is perhaps an API question, so maybe I should have posted in that forum, but I don't know for sure that there's no way in Excel to do what I want.
I could save the bytes to a temp file, then use LoadPicture() but this seems sloppy. How do I skip the saving-to-disk step? I am sincerely hoping I don't have to create a device context and such, and draw the dang thing using various API calls, since I have almost no experience with Windows API graphics and it's just a single silly picture load I am hoping to get done quickly!
I looked at GetObjectAPI but the bmBits property is returning a 0.
In order to do this task I also need to know how to retrieve the bits I've already loaded into the button's picture. I suppose I could just save a .bmp and use those raw bytes, which is fine, but I'd like the luxury of being able to display the bytes for commandbarbutton pictures without the intermediate step of saving them to a file. Plus, I'm interested to know how this all works. Perhaps I'll get into Windows graphics by bits and pieces...
Erik
PS This is perhaps an API question, so maybe I should have posted in that forum, but I don't know for sure that there's no way in Excel to do what I want.