关键词:Excel插件;COM组件;接口The Design and Implementation of the Conditionally Formatting Tool for Excel
Abstract
Excel is an electronic sheet software which is extensively used in various fields. By using it, we can organize and manage data, statistically analysis data easily. In practical applications, we need it usually need to specially show some data under certain conditions. This function can be achieved by using Excel macros. However,such a method is inconvenient in writing similar codes in each time. Excel, as long as other Microsoft Office softwares, povides a standard plug-in interface, also called add-in, to allow users to expand its functionalities. By writing addins for Excel, we can almost unlimitedly to expand its functionality and makes our work more easily and effectively. This paper introduces the design and implementation of an Excel conditional formatting addin, which is implemented by the COM component technique according to the interface requirements of Excel. The conditional formatting addin adds a new Toolbar into Excel, on which there is a button to be used to open the format setting dialog. The software can calculate the results of the condition expressions inputted by the user in the form of string, and according to the result, it sets the format of the cells matching the use-defined condition to special formats (font, color, font size and decoration) that was inputted by the user.