Example Code

Change Color of Specified Cell in Excel Using ActiveX

Code and Documents

Attachment

Introduction

The Interior Reference of an Active Cell can be used to access the ColorIndex property of a cell.  The Report Generation Toolkit for Microsoft Office can be used in conjunction with Invoke and Property Nodes to quickly acquire Excel ActiveX references.  More information on selectable colors can be found here:  http://msdn.microsoft.com/en-us/library/aa199411(office.10).aspx

Refer to http://msdn.microsoft.com/en-us/library/bb258731(v=office.12).aspx for properties and methods of the Interior Reference.

ChangeXLColor.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors