The ADD command is used to add sheets, cell styles, named areas, images, formulas, hyperlinks, comments and cell merges to an Excel document. The action taken will depend on the value of the object keyword.
ADD SHEET
Syntax:
|
Example
ADD OBJECT(*SHEET) SHEET(Sales)
ADD COMMENT
Syntax:
|
Example
ADD OBJECT(*COMMENT) R1C1(10,5) AREA(4,4) COMMENT(important data)
ADD CELL MERGE
Syntax:
|
Example
ADD OBJECT(*CELLMERGE) R1C1(10,5) R2C2(15,5)
ADD IMAGE
Syntax:
|
Example
ADD OBJECT(*IMAGE) R1C1(5,8) FILE(boat.png) RESIZE(0.5)
ADD OBJECT(*IMAGE) R1C1(2,3) R2C2(4,5) FILE(boat.png) RESIZE(*CELL) ROWHEIGHT(3000) COLUMNWIDTH(4000)
ADD OBJECT(*IMAGE) R1C1(6,3) R2C2(8,4) FILE(boat.jpg) RESIZE(*CELL) ANCHOR(*MOVEANDRESIZE) ROWHEIGHT(800) COLUMNWIDTH(4000) DX1DY1(10,20) DX2DY2(-10,-20)
ADD OBJECT(*IMAGE) R1C1(6,7) R2C2(8,8) FILE(boat.jpg) RESIZE(*CELL) ANCHOR(*NOMOVE) ROWHEIGHT(800) COLUMNWIDTH(4000)
ADD OBJECT(*IMAGE) R1C1(6,3) FILE(boat.jpg) RESIZE(*IMAGE) HEIGHT(100) ANCHOR(*MOVE) ROWHEIGHT(*CALC) COLUMNWIDTH(*CALC) DX1DY1(10,10)
ADD OBJECT(*IMAGE) R1C1(7,3) FILE(boat.jpg) RESIZE(*IMAGE) WIDTH(100) DX1DY1(10,10) ROWHEIGHT(*CALC) ANCHOR(*MOVE)
ADD FORMULA
Syntax:
|
Example
ADD OBJECT(*FORMULA) R1C1(4,2) FORMULA("SUM(H5:H44)")
ADD OBJECT(*FORMULA) R1C1(2,12) FORMULA("HYPERLINK(\"http://www.lansa.com\",\"Test Link\")")
ADD HYPERLINK
Syntax:
|
Example
ADD OBJECT(*HYPERLINK) R1C1(10,2) TYPE(*URL) ADDRESS(http://www.lansa.com) LABEL(LANSA Home)
ADD OBJECT(*HYPERLINK) R1C1(13,1) TYPE(*DOCUMENT) ADDRESS(MYSHEET!A2) LABEL(Employees)
ADD NAME
Syntax:
|
Example
ADD OBJECT(*NAME) NAME(TOTAL) REFERENCE(A1:C5)
ADD OBJECT(*NAME) NAME(TOTAL) REFERENCE(Sheet1!A1:C5) COMMENT(Total Amount)
ADD OBJECT(*NAME) NAME(TOTAL) REFERENCE(SUM(Sheet1!I$2:I$6)) COMMENT(Total Amount)
ADD CELL STYLE
Syntax:
|
FONT, BORDER and BACKGROUND COLORS
*AQUA |
*DARKTEAL |
*LIGHTCORNFLOWERBLUE |
*PLUM |
*AUTOMATIC |
*DARKYELLOW |
*LIGHTGREEN |
*RED |
*BLACK |
*GOLD |
*LIGHTORANGE |
*ROSE |
*BLUE |
*GREEN |
*LIGHTTURQUOISE |
*SEAGREEN |
*BLUEGREY |
*GREY25 |
*LIGHTYELLOW |
*SKYBLUE |
*BRIGHTGREEN |
*GREY40 |
*LIME |
*TAN |
*BROWN |
*GREY50 |
*MAROON |
*TEAL |
*CORAL |
*GREY80 |
*OLIVEGREEN |
*TURQUOISE |
*CORNFLOWERBLUE |
*INDIGO |
*ORANGE |
*VIOLET |
*DARKBLUE |
*LAVENDAR |
*ORCHID |
*WHITE |
*DARKGREEN |
*LEMONCHIFFON |
*PALEBLUE |
*YELLOW |
*DARKRED |
*LIGHTBLUE |
*PINK |
|
Example
ADD OBJECT(*CELLSTYLE) COLUMN(1,5) RANGE(3,5) FONT(*TAHOMA)
ADD OBJECT(*CELLSTYLE) TYPE(*NUMBER) COLUMN(8) FORMAT(*FORMAT4)
ADD OBJECT(*CELLSTYLE) TYPE(*STRING) COLUMN(1) RANGE(10,15) FONT(*ARIAL) BOLD(*YES)
ADD OBJECT(*CELLSTYLE) TYPE(*DATE) COLUMN(7) RANGE(20,25) FORMAT(dd mm yyyy)
ADD OBJECT(*CELLSTYLE) TYPE(*NUMBER) COLUMN(2) RANGE(10,15) FORMAT(#.##;#.##;-) HALIGN(*CENTRE) BACKGROUND(*YELLOW) FONT(*ARIAL) FONTSIZE(14.5) FONTCOLOR(*RED) ITALIC(*YES) BORDER(*ALL) BORDERCOLOR(*BLUE) BORDERSTYLE(*MEDIUM)