XLL+ Class Library (6.3)

CXlMacros::ActiveCellFont

Equivalent to formatting individual characters in a cell

static int ActiveCellFont(
   LPCTSTR font,
   LPCTSTR font_style = 0,
   unsigned short size = 0,
   short int strikethrough = -1,
   short int superscript = -1,
   short int subscript = -1,
   short int underline = -1,
   short int color = -1,
   short int normal = -1,
   short int background = 0,
   short int start_char = 0,
   short int char_count = -1
);

Parameters

font

Font is the name of the font as it appears in the Font tab. An empty string or a null pointer is treated as a missing argument.

font_style

Font_style is the name of the font style as it appears in the Font tab. An empty string or a null pointer is treated as a missing argument.

size

Size is the font size, in points. A value of 0 is treated as a missing argument.

strikethrough

Strikethrough corresponds to the Strikethrough check box. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

superscript

Superscript corresponds to the Superscript check box. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

subscript

Subscript corresponds to the Subscript check box. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

underline

Underline corresponds to the Underline Drop-down box. A value of -1 is treated as a missing argument, A value greater than or equal to 0 are treated normally.

color

Color is a number from 0 to 56 corresponding to the colors in the Font tab; 0 corresponds to automatic color. A value of -1 is treated as a missing argument, A value greater than or equal to 0 are treated normally.

normal

Normal corresponds to the Normal Font check box. A value of -1 is treated as a missing argument, A value greater than 0 is treated as TRUE, and 0 is treated as FALSE.

background

Background is a number from 1 to 3 specifying which type of background to apply to text in a chart. A value of 0 is treated as a missing argument, Values greater than 0 are treated normally.

start_char

Start_char specifies the first character to be formatted. A value of 0 is treated as a missing argument, Values greater than 0 are treated normally.

char_count

Char_count specifies how many characters to format. A value of 0 is treated as a missing argument, Values greater than 0 are treated normally.

Return Value

Zero if the function has been called successfully; non-zero if the function could not be called. See Error codes for a list of return values.

Remarks

See the Microsoft Excel on-line Help for full details about this function.

Requirements

Header: xlfuncs.h

See Also

CXlMacros Class | CXlMacros Methods