Skip to Content
author's profile photo Former Member
Former Member

How to set font size and font type for a column of excel sheet using OLE

Hi Experts !

Please can anyone let me know how to set the font size and font type

for a column or row in excel sheet using OLE to download excel file using OLE object

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2011 at 02:44 PM

    Assuming you have created the Excel application object as V_EXCEL...

      DATA: V_CRANGE TYPE OLE2_OBJECT,
            V_FONT   TYPE OLE2_OBJECT.
    ...
    * Set font for Column F
        CALL METHOD OF V_EXCEL 'Range' = V_CRANGE
                               EXPORTING #1 = 'F:F'.
        CALL METHOD OF V_CRANGE 'Select'.
        GET PROPERTY OF V_CRANGE 'font'    = V_FONT.
        SET PROPERTY OF V_FONT 'SIZE'      = 11.
        SET PROPERTY OF V_FONT 'NAME'      = 'Arial'.
    
    * Set font for Row 5 - 8
        CALL METHOD OF V_EXCEL 'Range'     = V_CRANGE
                              EXPORTING #1 = '5:8'.        " Rows 5 - 8
        CALL METHOD OF V_CRANGE 'Select'.
        GET PROPERTY OF V_CRANGE 'font'    = V_FONT.
        SET PROPERTY OF V_FONT 'SIZE'      = 11.
        SET PROPERTY OF V_FONT 'NAME'      = 'Arial'.
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.