Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The elements in the arguments array passed to executeDispatch() should be of type com.sun.star.beans.PropertyValue.

please try instead the following approach :

Sub Main
    DeleteColumns( 98, 5 )
    DeleteColumns( 92, 5 )
    DeleteColumns( 81, 2 )
    DeleteColumns( 66, 1 )
    DeleteColumns( 54, 8 )
    DeleteColumns( 47, 5 )
    DeleteColumns( 42, 1 )
    DeleteColumns( 37, 3 )
    DeleteColumns( 35, 1 )
    DeleteColumns( 33, 1 )
    DeleteColumns( 17, 1 )
    DeleteColumns( 14, 1 )
    DeleteColumns( 6,1 )
    DeleteColumns( 0, 4 )
End Sub

Sub DeleteColumns( lColumnIndex As Long, lCount As Long )
REM Deletes <lCount> Columns from the current Sheet, starting at column <lColumnIndex>.
    Dim oSheet As Object, oColumns As Object
    oSheet = ThisComponent.CurrentController.ActiveSheet
    oColumns = oSheet.getColumns()
    oColumns.removeByIndex( lColumnIndex, lCount )
End Sub