Have cut and pasted from various sites but each time I get:-
"Basic runtime Error" An Eception occurred $(ARG1).
EXAMPLE1 from Andrew Pitonyak
Code: Select all
Sub ClearDefinedRange
Dim Doc As Object
Dim Sheet As Object
Dim CellRange As Object
Dim Flags As Long
Doc = StarDesktop.CurrentComponent
Sheet = Doc.Sheets(0)
CellRange = Sheet.getCellRangeByName("B71:E83")
Flags = com.sun.star.sheet.CellFlags.STRING + _ <<< ERROR POINTS TO THIS LINE
com.sun.star.sheet.CellFlags.HARDATTR
CellRange.clearContents(Flags)
End Sub
Code: Select all
Sub ClearCellContents
Dim nFlags As Long
Dim oRange As New com.sun.star.table.CellRangeAddress
oRange = oSheet.getCellRangeByName( "B71:E83" )
nFlags = com.sun.star.sheet.CellFlags.STRING + _ <<< ERROR POINTS TO THIS LINE
com.sun.star.sheet.CellFlags.STYLES
oRange.clearContents( nFlags )
End Sub