Use Custom Images
To create a button on the Ribbon, you need to assign image to it. You can create interface which has only Labels, Command Buttons, Comboboxes and Separators. But it will not look good. In order to create perfect modern application you need to use your own images in the User Interface.
xlCompiler has 2 methods to add images to the application. We'll start from the first one, which is recommended by Spreadsheet Tools.
Open your xlCompiler project and switch to the Images tab
Images added to the xlCompiler project are embedded into compiled file as resources. You can assign Name to the every image and refer to the image by this name in the VBA Code.
First method - use Right Click Menu:
Add Image command selects Image on disk and ads it to the project.
Second method - drag'n'drop. Select files you need in the Windows Explorer and drag them to the Image tab. xlCompiler add all of them to the project.
As an alternative you can add images directly to the compiled workbook using VBA macro:
#If XLC Then With Application.Icons .Add "Calendar", "*Path to file on disk*\calendar.ico" End With #End If
Method Add of the Application.Icons collection adds new icon to the application.
It has following arguments:
Name - name of the image
File - path to the image file on disk
When you install compiled application on the customer's PC, you need to install image files, and know path to the installed file. This is not a robust solution.
This method works, but we suggest to add images to the project file.
This is important question. xlCompiler uses 16x16 images for small buttons and 32x32 images to the large buttons. So your image should have one of these sizes.