excel

Question:
hi! is there a way i can change the property of the excel cells via a function module? which function module should i use?
i.e. from numeric format i want to change it to custom...
thanks in advance.
Answer:
You write your own.
Record what you want to do using the Excel macro recorder. That gives you the methods, properties and values that you need. You then write that in ABAP.
The example below, while not quite what you're after shows this:
This is the VBA Code to set cell alignments:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 03/06/2003 by Rard Harper
'
'
    Range("A1").Select
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .ShrinkToFit = False
        .MergeCells = False
    End With
End Sub
Here's the same thing in ABAP.
*Eject
**********************************************************************
*
*       Procedure:               Set_Alignment
*
*       Purpose:                 Sets the alignment for a cell
*
*       Entry:                   Work Sheet
*       Entry:                   Cell Range to Set alignment for
*       Entry:                   Alignment
*
*       Exit:
*
*       Called By:               Perform Set_Alignment using w_sheet
*                                                            'A4:B7'
*                                                           xlAlignRight
*
*       Calls:
*
*       Modification History:
*
Form Set_Alignment using pu_sheet     type Ole2_Object
                         pu_range     type XlRangeAddress
                         pu_Alignment type XlAlignment.
*
     Data: Range   type Ole2_Object.
*
     Call Method of pu_Sheet 'Range' = Range Exporting #1 = pu_Range.
     Set Property Of Range: 'HorizontalAlignment' = pu_Alignment,
                            'VerticalAlignment'   = XlVAlignBottom,
                            'WrapText'            = XlFalse,
                            'Orientation'         = 0,
                            'AddIndent'           = XlFalse,
                            'ShrinkToFit'         = XlFalse.
     Free Object Range.
EndForm.
Easy enough to do.
Regards
R
_________________
Regards
R
Abap KC

SFMDR

More Articles:

All Guru's?
How to Copy Sales Order from Production server to Developme?
Batch Input / BAPI for Transaction MIR4 (Parked Invoice)?
Transfer Order cancellation flag?
How to Create Match Code?
LSMW---- Vendor Invoice !!! Urgent !!!!?