Application Development 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: 

open an excel sheet with a specific focus

crepmaster
Participant
0 Kudos

Hi expert, it is possible to open an excel sheet with a focus on a specific row?

i'm using the

CALL METHOD document->open_document

     EXPORTING document_title = document_title

            document_url = document_url

            open_inplace = open_inplace

            no_flush = no_flush

     IMPORTING error = error

           retcode = retcode.

i though i could use the method show_rows or set_focus  but i getting an error,

do i need to specify a range before?

do you guys have any example?

thank you and regards

1 ACCEPTED SOLUTION

crepmaster
Participant
0 Kudos

solved it by  playing with the set_selection and the range, may be there is a better way but alteast it's working

gc_spreadsheet->select_sheet(

     EXPORTING

       name     = v_range_nam    " Name of Worksheet

       no_flush = ' '    " Flush?

     IMPORTING

       error    gt_errors   " Error?

       retcode  lf_retcode   " Text of Error

   ).

   gc_spreadsheet->set_selection(

     EXPORTING

       left     1   " Line of Top Left-Hand Cell

       top      60   " Column of Top Left-Hand Cell

       rows     1   " Lines

       columns  50   " Columns

*    no_flush = ' '    " Flush?

     updating = -1    " Screen Updating

*  IMPORTING

*    error    =     " Error?

*    retcode  =     " Text of Error

   ).

   CALL METHOD gc_spreadsheet->insert_range

     EXPORTING

       name     = 'ranges'

       rows     = '1'

       columns  = '5'

       no_flush = ''

     IMPORTING

       error    = gt_errors.

   APPEND gt_errors.

1 REPLY 1

crepmaster
Participant
0 Kudos

solved it by  playing with the set_selection and the range, may be there is a better way but alteast it's working

gc_spreadsheet->select_sheet(

     EXPORTING

       name     = v_range_nam    " Name of Worksheet

       no_flush = ' '    " Flush?

     IMPORTING

       error    gt_errors   " Error?

       retcode  lf_retcode   " Text of Error

   ).

   gc_spreadsheet->set_selection(

     EXPORTING

       left     1   " Line of Top Left-Hand Cell

       top      60   " Column of Top Left-Hand Cell

       rows     1   " Lines

       columns  50   " Columns

*    no_flush = ' '    " Flush?

     updating = -1    " Screen Updating

*  IMPORTING

*    error    =     " Error?

*    retcode  =     " Text of Error

   ).

   CALL METHOD gc_spreadsheet->insert_range

     EXPORTING

       name     = 'ranges'

       rows     = '1'

       columns  = '5'

       no_flush = ''

     IMPORTING

       error    = gt_errors.

   APPEND gt_errors.