21.08.2013 Views

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

OpenOffice.org BASIC Guide.pdf - OpenOffice.org wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Cells and Ranges 130<br />

Cell.Value = 1000<br />

Select Case Cell.Type<br />

Case com.sun.star.table.CellContentType.EMPTY<br />

MsgBox "Content: Empty"<br />

Case com.sun.star.table.CellContentType.VALUE<br />

MsgBox "Content: Value"<br />

Case com.sun.star.table.CellContentType.TEXT<br />

MsgBox "Content: Text"<br />

Case com.sun.star.table.CellContentType.FORMULA<br />

MsgBox "Content: Formula"<br />

End Select<br />

The Cell.Type property returns a value for the<br />

com.sun.star.table.CellContentType<br />

enumeration which identifies the contents type of a cell. The possible values are:<br />

EMPTY<br />

VALUE<br />

TEXT<br />

no value<br />

number<br />

strings<br />

FORMULA<br />

formula<br />

Inserting, Deleting, Copying and Moving Cells<br />

In addition to directly modifying cell content, <strong>OpenOffice</strong>.<strong>org</strong> Calc also provides an<br />

interface that allows you to insert, delete, copy, or merge cells. The interface (<br />

com.sun.star.sheet.XRangeMovement<br />

) is available through the spreadsheet object and provides four methods for modifying cell<br />

content.<br />

The insertCell method is used to insert cells into a sheet.<br />

Dim Doc As Object<br />

Dim Sheet As Object<br />

Dim CellRangeAddress As New com.sun.star.table.CellRangeAddress<br />

Doc = StarDesktop.CurrentComponent<br />

Sheet = Doc.Sheets(0)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!