XLL+ Class Library (7.0)

ExUIDynList Sample

Changes the contents of a value list at run-time

Remarks

This project demonstrates how to change the contents of a value list at run-time or at load-time. It contains a single worksheet function and two macro functions.

The worksheet function, MyFunction is an empty function that uses a value list. The value list is set to be exclusive and to be displayed in the Excel Formula Wizard.

The two macros, UseValueList1 and UseValueList2, each load a different value list, calling the function LoadValueList.

LoadValueList contains the interesting code: it loads a set of values, updates the extended user interface by using CXlWizExUIFunctionDescriptor::AddList, and also updates the value list constraint by using CXlValueListConstraint<long>::SetValues.

Note that the initialization of the value list occurs very late in the loading process, during an override of CXllApp::AfterXllOpen.

Classes and functions used

CXlWizExUIListProvider::CXlWizExUIListProvider | CXlWizExUIListProvider::Add | CXlWizExUIFunctionRegistry::GetInstance | CXlWizExUIFunctionRegistry::FindAddFunctionDescriptor | CXlWizExUIFunctionDescriptor::AddList | CXlValueListConstraint<INT_T>::SetValues

Sample project

Each sample project is located in a sub-directory of the Samples directory of the XLL+ installation. To use the sample project, open the solution file ExUIDynList.sln or the project file ExUIDynList.vcproj.

You can enable debugging under Excel by using the Setup Debugging command in the XLL+ ToolWindow.

When delivered, the help files are excluded from the build. You can enable the help build by selecting the files ExUIDynList.help.xml and ExUIDynList.chm in the Solution Explorer, and using the right-click menu to view Properties. Select the page "Configuration Properties/General" and set the "Excluded from build" property to "No". See Generating help in the User Guide for more information.

See Also

List of Sample Projects