Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   [openCalc Macro] gotoCell (https://www.delphipraxis.net/150671-%5Bopencalc-macro%5D-gotocell.html)

MrSpock 23. Apr 2010 09:56


[openCalc Macro] gotoCell
 
Hallo,

in einem OpenCalc Macro habe ich mir die aktuelle Position gemerkt:

Code:
oCell = ThisComponent.getCurrentSelection
An einer anderen Stelle möchte ich jetzt wieder an diese Stelle springen:

Code:
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = oCell

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
funktioniert nicht, weil oCell offensichtlich nicht als "String" interpretiert wird, der wohl als "Value" erwartet wird.

Wie springe ich also an die oCell Position?

MrSpock 23. Apr 2010 10:56

Re: [openCalc Macro] gotoCell
 
Hallo,

hab jetzt eine Lösung zusammengebaut:

Merke mir die CellAddress
Code:
oCell = ThisComponent.getCurrentSelection.CellAddress
und frickel mir dann die Adresse zusammen:

Code:
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$"+Trim(Chr$(Asc("A")+oCell.Column))+"$"+Trim(Str(oCell.Row+1))
Vielleicht gibt es eine elegantere Möglichkeit, aber es funktioniert so.


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:34 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz