on 11-23-2004 6:38 PM
Does anybody knows how can I give format to columns and rows to an MS Excel sheet created with Ole2.
I want to give columns width, and to fit to text.
Thanks.
Message was edited by: Joaquin Da Silva
Hi Joaquin
I believe this will do your work:
....
DATA gs_range TYPE ole2_object .
....
*--Creating OLE object for MS Excel
....
CALL METHOD OF gs_excel 'Range' = gs_range
EXPORTING #1 = 'A:A' .
SET PROPERTY OF gs_range 'ColumnWidth' = '20' .
SET PROPERTY OF gs_range 'ShrinkToFit' = '1' .
....
Hope this helps...
*--Serdar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works, thank you very much.
Do you know where can I find a list of all the properties I can set??.
Now I want to give borders to cells and I'm having the same problem trying to find how to work it out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joaquin,
To find out what possible methods and/or properties you could use, you simply need to startup MS Excel (and with a worksheet active).
Open the visual basic editor (Menu: Extra -> Macro -> Visual Basic Editor , or press Alt+F11).
Herein open the Object viewer (Menu: View -> Object overview , or press F2).
Switch from All Libraries to only Excel Library and there you'll find all the possible details.
Left all the classes and Right all the component of a selected class.
For example to modify borders of a cell you will need to have class CellFormat and for the colors Class Interior.
Hope this answers your question.
Regards,
Rob.
Hi Joaquin
<u>Firstly</u>, Rob's explanation is the best way to retrieve information about OLE methods and properties.
<u>Secondly</u>;
Happy that you have solved your question. Would you like to reward points for useful answers?
To do so, first you should convert your thread as a question thread. You can achieve this by editing your first post and checking the relevant checkbox and then saving it.
After this step, each post (except yours) will have a yellow star at its header. You can assign points to each post by clicking that yellow star at its header. You can reward;
- one 10 points (solved)
- two 6 points (very helpful answer)
- many 2 points (helpful answer)
This is the way to thank contributing people at SDN.
Kind regards
*--Serdar
Hi Rob,
Could you help me in issues of plotting Excel graphs using ABAP - OLE. This will help me a lot.
The requirement is:-
I am able to plot a graph for the data in ABAP program. But the graph gets plotted for all the Excel columns and I need graph only for few columns. How do I select only a few columns.
Secondly, the chart types need to be different for different worksheet wcolumns as this is not the case.
If you could provide some code sample, this will help a lot.
Thanks in advance.
Regards,
Vinayak Kale
User | Count |
---|---|
75 | |
9 | |
8 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.