Ennio-Sr wrote:
* Andrew Douglas Pitonyak <[EMAIL PROTECTED]> [280605, 20:33]:
Ennio-Sr wrote:
Hi all,
After grouping seven different spreadsheets in a single
'multiplesheets' document I'm at a loss, now, being no longer able to
use the common library macros: for them to work as they did before
I should be able to make the macro 'know' which sheet it's acting on,
so that it can choose the appropriate parameters.
Perusing into the docs I discovered the 'getActiveSheet()' _thing_ (in
com.sun.star.sheet) but could not find any example of its use I could
understand or, at least, make work ... ;-(
As I would like to test it now (and not after having fully understood
how the whole 'API affair' works, which may well take some very long
time) could some of you suggest some good example?
Regards,
Ennio.
If I remember correctly, you own a copy of my book.
Look at page 249, 260, and 261 for examples.
Look at Table 52 on Page 372 for a description.
Now, for a test of your understanding of how things are setup, read the
first paragraph on page 190. Also, read the fifth paragraph on the same
page. The real meat of what you want to know, however, starts in Chapter
12. Just start reading. It is again explained in paragraph three.
After you understand the usage of the controller, it becomes obvious why
you ask the current controller for the view cursor, the active sheet, etc.
Hi Andrew,
thanks for your answer; unluckily I don't have a copy of your book and
there is no quick way to get it, at least where I live ;-(. I searched
bookshops and Universities libraries to no avail; OTOH starting a
regular study of macros does not fit in my current plans, so I gave up.
I did find some examples around, but there is still something which I
cannot grasp, i.e. whether the *getActiveSheet()* would return the
spreadsheet name or its cardinal number. Running this macro:
Sub getsheet
oDoc=ThisComponent
oSheet=oDoc.CurrentController.getActiveSheet()
End sub
doesn't throw any error, neither seems to yeald any result: adding:
MsgBox oSheet
will produce a box with an 'OK' in it and soon after a *Basic Runtime
Error: incorrect property value* warning.
In case I'm too far from a solution, never mind: I'll return to my seven
separate spreadsheets and stop bothering myself and the ML with things
beyond my present capacity to understand :-)
Thanks again,
Ennio.
Hmm, I probably should have known this since we have exchanged email. My
mistake....
You can order a PDF version directly from the publisher and download it
if you want a copy....
Well, the current controller knows which sheet is the active sheet. You
also use the current controller to set the active sheet. The current
controller also knows how to select objects. It is the current
controller that tells you what is selected and you can use it to select
various items in a document.
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info: http://www.pitonyak.org/oo.php
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]