Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

OLE Excel object-Selecting Range

praveen_hannu
Contributor
0 Likes
1,746

Hi Experts

I am importing result into one excel sheet and I am making it auto fit using OLE objects. I am facing the problem to select the range of columns and set the format as text. I am trying to in different ways but failing at selecting the range.

CALL METHOD OF book 'WORKSHEETS' = sheets.
CALL METHOD OF excel 'CELLS' = cell.
  CALL METHOD OF cell 'EntireColumn' = ole_columns .
  CALL METHOD OF ole_columns 'AutoFit'.
  call METHOD of excel 'COLUMNS' = columns.
  set PROPERTY OF columns 'RANGE' = 'A:K'.
  CALL METHOD of columns 'SELECTION' = selection.
  CALL METHOD of selection 'NUMBERFORMAT' = numberfor.
  set PROPERTY OF numberfor 'NUMBERFORMAT' = '@'.

Could you please correct me where I am going wrong.

Thanks

Praveen

1 REPLY 1
Read only

praveen_hannu
Contributor
0 Likes
732

small issue while accessing the cells, actual method is

call METHOD of excel 'RANGE' = columns EXPORTING #1 = 'A:K'.

set PROPERTY OF columns 'NUMBERFORMAT' = '@'.