Move sheet on screen

Questions and answers on how to use XLSSpreadSheet.
Post Reply
hugvis
Posts: 7
Joined: Mon Nov 22, 2021 6:23 pm

Move sheet on screen

Post by hugvis »

Hello Lars.

Regard: Delpi 10.3 and your component version: 6.01.07

Over the xmas iv'e been trying to figure out how to by code, move sheet on screen to location in sheet 0, col 14 and row 150 using this code:
XLSGrid1.XLS[0].SelectedAreas.CursorCell( 14, 150 );
XLSGrid1.Invalidate;

or this:

XLSGrid1.XLS.Sheets[0].SelectedAreas.CursorCell( 14, 150 );
XLSGrid1.Invalidate;
Either of this piece of code work

What we are seeking, is moving sheet on location C,R and make cell at C,R location, visible to user.
If this is wrong method, then please reply here with correct one.

I include here project link to ZIP file on our fileserver, where this demonstration of this does not work. I urge you to download it and tested your self. https://skrar.bondi.is/data/public/d68d86

Anyhow i want solution on this.

Best rg.
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Move sheet on screen

Post by larsa »

Hello

As TXLSGrid is based on TDrawGrid, use methods and properties of TDrawGrid.

To set focus cell:

Code: Select all

XLSGrid1.Col := 14;
XLSGrid1.Row := 150;
Lars Arvidsson, Axolot Data
hugvis
Posts: 7
Joined: Mon Nov 22, 2021 6:23 pm

Re: Move sheet on screen

Post by hugvis »

Ok.
Thank you Lars. This worked, but it moved C,R location on all sheet in same workbook.
But still in question how to do this on many sheets, one by one with different C,R for each sheet ??

Also i want you to confirm right import of the package you bought from you. Allow me to send screenshot in email to show you.

Rg. Hjalmar
Post Reply