I have an Excel 2007 worksheet with many buttons and labels that act as menu options (i.e. the user clicks buttons, labels with images) and is represented by forms or something else.
These images / icons for buttons and labels are loaded into VBA by setting the Image property of the control and calling the LoadPicture () method with the full path to the image file as a parameter, for example, So.
With SomeFormObject
.cmdOpenFile.Picture = LoadPicture("F:\projectname\images\fileopen.BMP")
End With
This method of loading images for buttons, other controls causes 2 problems.
1) It creates a dependency on image files and physical location for each user, therefore, if the user does not have a mapped drive and files present, VBA fails with a runtime error of a file or path that was not found.
2) The application becomes very slow if the images are on a shared disk (this is so)
I want to fix both problems and somehow upload icons, images to the management internally, without any external dependencies on external image files.
What is the best way to achieve this in Excel 2007 VBA?
I could not load any Visual Basic 6.0 / Visual Studio Style "Resource File Editor" / function with which you can accomplish this.
I ask for advice! thank
-Shiva @
mycodetrip.com