Re: [libreoffice-users] Macros in spreadsheets

2023-01-08 Thread Steve Edmonds

OK, found the sheet.
Had to copy it from the machine I used the sheet on last month as can't 
access physically the machine ATM.
The sheet was working fine on that machine but produces the symptoms you 
mention on this laptop. I will see if I can find the cause.

Steve

On 4/01/23 8:51 am, Steve Edmonds wrote:
I understand what you are seeing, I had the same issue with a macro 
for a function, I called it money() for rounding financial tax 
calculations appropriately. At some point when I updated LO it just 
stopped calculating displaying as you describe and I had to go through 
the same rigmarole you are experiencing for it to recalculate.
Not sure if I resolved the issue or gave up, I will need to dig the 
sheet out.

Steve

On 3/01/23 11:13 am, Michael Tiernan wrote:

On 12/23/22 11:02 AM, Andrew Pitonyak wrote:

If you are looking to cause functions to recalculate,


Thanks for the reply.

Here's the thing. It's not that I want to force a recalculate, it's 
that I have to in order to get the macros to respond.


Here's an example: (What I expect when the spreadsheet finishes 
opening.)


/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
192.168.17.231
D3
=ipmask(D1)
255.255.255.0
D4
=ipmasklken(D3)
24

Now, when I actually do open the spreadsheet, it says:

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
#NAME?
D3
=ipmask(D1)
#NAME?
D4
=ipmasklken(D3)
#NAME?

So, if I say it differently, it *seems* like the Macros aren't run 
when the spreadsheet is opened.


The macro library has a "Main" entry that is empty. If I choose 
"Tools" -> "Macros" -> "Run macro" and then select "Main" and execute 
it, there's no visible change.


BUT, if I go into the contents of "D2" and add a space at the end of 
the formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and 
hit return and the macro executes and displays the proper value.


HOWEVER, none of the other cells change so I have to go into each one 
and do the same sort of thing, add a space at the end of the line or 
between the macro and the parenthesis, each time, hit return and it 
works properly.


This is obviously not the correct way it should work.

Hence my query about "starting" macros when the document is opened.

So, that leads to, am *I* doing something wrong?

Thanks for everyone's time.






--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: ***SPAM*** Re: [libreoffice-users] Macros in spreadsheets

2023-01-04 Thread Steve Edmonds
That happens to me with some list emails, easiest solution is to add a 
rule to prevent classing as spam.

Steve

On 5/01/23 5:36 am, Tim-L wrote:


Your mail list emails are now being marked as spam.  Why, I cannot 
find out.




On 1/3/23 14:51, Steve Edmonds wrote:
I understand what you are seeing, I had the same issue with a macro 
for a function, I called it money() for rounding financial tax 
calculations appropriately. At some point when I updated LO it just 
stopped calculating displaying as you describe and I had to go 
through the same rigmarole you are experiencing for it to recalculate.
Not sure if I resolved the issue or gave up, I will need to dig the 
sheet out.

Steve

On 3/01/23 11:13 am, Michael Tiernan wrote:

On 12/23/22 11:02 AM, Andrew Pitonyak wrote:

If you are looking to cause functions to recalculate,


Thanks for the reply.

Here's the thing. It's not that I want to force a recalculate, it's 
that I have to in order to get the macros to respond.


Here's an example: (What I expect when the spreadsheet finishes 
opening.)


/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
192.168.17.231
D3
=ipmask(D1)
255.255.255.0
D4
=ipmasklken(D3)
24

Now, when I actually do open the spreadsheet, it says:

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
#NAME?
D3
=ipmask(D1)
#NAME?
D4
=ipmasklken(D3)
#NAME?

So, if I say it differently, it *seems* like the Macros aren't run 
when the spreadsheet is opened.


The macro library has a "Main" entry that is empty. If I choose 
"Tools" -> "Macros" -> "Run macro" and then select "Main" and 
execute it, there's no visible change.


BUT, if I go into the contents of "D2" and add a space at the end of 
the formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and 
hit return and the macro executes and displays the proper value.


HOWEVER, none of the other cells change so I have to go into each 
one and do the same sort of thing, add a space at the end of the 
line or between the macro and the parenthesis, each time, hit return 
and it works properly.


This is obviously not the correct way it should work.

Hence my query about "starting" macros when the document is opened.

So, that leads to, am *I* doing something wrong?

Thanks for everyone's time.









--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: ***SPAM*** Re: [libreoffice-users] Macros in spreadsheets

2023-01-04 Thread Tim-L


Your mail list emails are now being marked as spam.  Why, I cannot find out.



On 1/3/23 14:51, Steve Edmonds wrote:
I understand what you are seeing, I had the same issue with a macro 
for a function, I called it money() for rounding financial tax 
calculations appropriately. At some point when I updated LO it just 
stopped calculating displaying as you describe and I had to go through 
the same rigmarole you are experiencing for it to recalculate.
Not sure if I resolved the issue or gave up, I will need to dig the 
sheet out.

Steve

On 3/01/23 11:13 am, Michael Tiernan wrote:

On 12/23/22 11:02 AM, Andrew Pitonyak wrote:

If you are looking to cause functions to recalculate,


Thanks for the reply.

Here's the thing. It's not that I want to force a recalculate, it's 
that I have to in order to get the macros to respond.


Here's an example: (What I expect when the spreadsheet finishes 
opening.)


/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
192.168.17.231
D3
=ipmask(D1)
255.255.255.0
D4
=ipmasklken(D3)
24

Now, when I actually do open the spreadsheet, it says:

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
#NAME?
D3
=ipmask(D1)
#NAME?
D4
=ipmasklken(D3)
#NAME?

So, if I say it differently, it *seems* like the Macros aren't run 
when the spreadsheet is opened.


The macro library has a "Main" entry that is empty. If I choose 
"Tools" -> "Macros" -> "Run macro" and then select "Main" and execute 
it, there's no visible change.


BUT, if I go into the contents of "D2" and add a space at the end of 
the formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and 
hit return and the macro executes and displays the proper value.


HOWEVER, none of the other cells change so I have to go into each one 
and do the same sort of thing, add a space at the end of the line or 
between the macro and the parenthesis, each time, hit return and it 
works properly.


This is obviously not the correct way it should work.

Hence my query about "starting" macros when the document is opened.

So, that leads to, am *I* doing something wrong?

Thanks for everyone's time.






--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros in spreadsheets

2023-01-03 Thread Steve Edmonds
I understand what you are seeing, I had the same issue with a macro for 
a function, I called it money() for rounding financial tax calculations 
appropriately. At some point when I updated LO it just stopped 
calculating displaying as you describe and I had to go through the same 
rigmarole you are experiencing for it to recalculate.
Not sure if I resolved the issue or gave up, I will need to dig the 
sheet out.

Steve

On 3/01/23 11:13 am, Michael Tiernan wrote:

On 12/23/22 11:02 AM, Andrew Pitonyak wrote:

If you are looking to cause functions to recalculate,


Thanks for the reply.

Here's the thing. It's not that I want to force a recalculate, it's 
that I have to in order to get the macros to respond.


Here's an example: (What I expect when the spreadsheet finishes opening.)

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
192.168.17.231
D3
=ipmask(D1)
255.255.255.0
D4
=ipmasklken(D3)
24

Now, when I actually do open the spreadsheet, it says:

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
#NAME?
D3
=ipmask(D1)
#NAME?
D4
=ipmasklken(D3)
#NAME?

So, if I say it differently, it *seems* like the Macros aren't run 
when the spreadsheet is opened.


The macro library has a "Main" entry that is empty. If I choose 
"Tools" -> "Macros" -> "Run macro" and then select "Main" and execute 
it, there's no visible change.


BUT, if I go into the contents of "D2" and add a space at the end of 
the formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and hit 
return and the macro executes and displays the proper value.


HOWEVER, none of the other cells change so I have to go into each one 
and do the same sort of thing, add a space at the end of the line or 
between the macro and the parenthesis, each time, hit return and it 
works properly.


This is obviously not the correct way it should work.

Hence my query about "starting" macros when the document is opened.

So, that leads to, am *I* doing something wrong?

Thanks for everyone's time.




--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros in spreadsheets

2023-01-02 Thread Michael H
Recalculate:

Force recalculate - F9 by default, but could be reassigned. OR on the menu
at Data --> Calculate --> Recalculate

There's also "recalculate hard" which is (probably misunderstood by me)
like the first calculate on load. CTRL-F9 or the same menu as recalculate.

___

Macros:

Tools --> options --> Libreoffice --> Security --> Macro Security



On Fri, Dec 23, 2022 at 9:51 AM Michael Tiernan 
wrote:

> I have a couple of BASIC macros in a spreadsheet.
>
> I keep thinking that there must be a "init" function that isn't being
> called because each time I open the spreadsheet, the macros don't run. I
> have to mess about a bit and then force each cell to recalculate
> manually. (I'm sure that there's a global 'recalculate' button/tool
> somewhere but that's secondary to the problem.)
>
> I know there's a lot of documentation out there on macros (almost too
> much) but I'm not sure where to start reading, does anyone have a
> pointer that would address, not how to create a macro but how to
> incorporate it to become automatic?
>
> Thanks.
>
> --
><< MCT >> Michael C Tiernan. http://www.linkedin.com/in/mtiernan
>Non Impediti Ratione Cogatationis
>Women and cats will do as they please, and men and dogs
> should relax and get used to the idea. -Robert A. Heinlein
>
>
> --
> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros in spreadsheets

2023-01-02 Thread Andrew Pitonyak

I am having trouble following what is happening (and I guess I missed the first 
reply.

First, it looks like the cell D2 is calling a macro. 

If I understand, the cells are NOT recalculating so you are causing each one to 
run manually. What happens if you use 

Data > Calculate > Recalculate (or F9) to cause every cell to recalculate?

If that works, you can also write a macro to cause it to recalculate. I do not 
remember off hand how to do that (and I don't want to take the time to look it 
up), but, I did record this macro that uses the dispatcher to do it. I feel 
like it is cheating but it should work just fine.

sub recalculate
  document   = ThisComponent.CurrentController.Frame
  dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
  dispatcher.executeDispatch(document, ".uno:Calculate", "", 0, Array())
end sub


On Monday, January 02, 2023 20:22 EST, Stephen Morris 
 wrote:
 On 3/1/23 09:13, Michael Tiernan wrote:
> On 12/23/22 11:02 AM, Andrew Pitonyak wrote:
>> If you are looking to cause functions to recalculate,
>
> Thanks for the reply.
>
> Here's the thing. It's not that I want to force a recalculate, it's
> that I have to in order to get the macros to respond.
>
> Here's an example: (What I expect when the spreadsheet finishes opening.)
>
> /*Cell*//*
> */ /*Contents*//*
> */ /*Display*//*
> */
> D1
> 192.168.17.231/24
> 192.168.17.231/24
> D2
> =ipwithoutmask(D1)
> 192.168.17.231
> D3
> =ipmask(D1)
> 255.255.255.0
> D4
> =ipmasklken(D3)
> 24
>
> Now, when I actually do open the spreadsheet, it says:
>
> /*Cell*//*
> */ /*Contents*//*
> */ /*Display*//*
> */
> D1
> 192.168.17.231/24
> 192.168.17.231/24
> D2
> =ipwithoutmask(D1)
> #NAME?
> D3
> =ipmask(D1)
> #NAME?
> D4
> =ipmasklken(D3)
> #NAME?
>
> So, if I say it differently, it *seems* like the Macros aren't run
> when the spreadsheet is opened.
>
> The macro library has a "Main" entry that is empty. If I choose
> "Tools" -> "Macros" -> "Run macro" and then select "Main" and execute
> it, there's no visible change.
>
> BUT, if I go into the contents of "D2" and add a space at the end of
> the formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and hit
> return and the macro executes and displays the proper value.
>
> HOWEVER, none of the other cells change so I have to go into each one
> and do the same sort of thing, add a space at the end of the line or
> between the macro and the parenthesis, each time, hit return and it
> works properly.
>
> This is obviously not the correct way it should work.
>
> Hence my query about "starting" macros when the document is opened.
>
> So, that leads to, am *I* doing something wrong?
>
> Thanks for everyone's time.
>
Not being familiar with Calc's macro functionality, what you are showing
as your macro references looks like a formula, so I would check two
things, which you may have already checked as I also haven't been
following this thread, check your macro security options as they may be
preventing your macros from running as the default option is to prevent
unsigned macros from running. Also check your formula "recalculate of
load" options as they may be set to not recalculate.

With your main entry being empty I would expect running that to actually
do nothing.
Looking at the existing macro definitions and the way they are shown
when placing the cursor in them, I would assume your macros are within a
module, so when you reference the macro in your formula, do you need to
reference is as, for example, .ipwithoutmask(D1)?

regards,
Steve

 

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros in spreadsheets

2023-01-02 Thread Stephen Morris

On 3/1/23 09:13, Michael Tiernan wrote:

On 12/23/22 11:02 AM, Andrew Pitonyak wrote:

If you are looking to cause functions to recalculate,


Thanks for the reply.

Here's the thing. It's not that I want to force a recalculate, it's 
that I have to in order to get the macros to respond.


Here's an example: (What I expect when the spreadsheet finishes opening.)

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
192.168.17.231
D3
=ipmask(D1)
255.255.255.0
D4
=ipmasklken(D3)
24

Now, when I actually do open the spreadsheet, it says:

/*Cell*//*
*/ /*Contents*//*
*/ /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
#NAME?
D3
=ipmask(D1)
#NAME?
D4
=ipmasklken(D3)
#NAME?

So, if I say it differently, it *seems* like the Macros aren't run 
when the spreadsheet is opened.


The macro library has a "Main" entry that is empty. If I choose 
"Tools" -> "Macros" -> "Run macro" and then select "Main" and execute 
it, there's no visible change.


BUT, if I go into the contents of "D2" and add a space at the end of 
the formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and hit 
return and the macro executes and displays the proper value.


HOWEVER, none of the other cells change so I have to go into each one 
and do the same sort of thing, add a space at the end of the line or 
between the macro and the parenthesis, each time, hit return and it 
works properly.


This is obviously not the correct way it should work.

Hence my query about "starting" macros when the document is opened.

So, that leads to, am *I* doing something wrong?

Thanks for everyone's time.

Not being familiar with Calc's macro functionality, what you are showing 
as your macro references looks like a formula, so I would check two 
things, which you may have already checked as I also haven't been 
following this thread, check your macro security options as they may be 
preventing your macros from running as the default option is to prevent 
unsigned macros from running. Also check your formula "recalculate of 
load" options as they may be set to not recalculate.


With your main entry being empty I would expect running that to actually 
do nothing.
Looking at the existing macro definitions and the way they are shown 
when placing the cursor in them, I would assume your macros are within a 
module, so when you reference the macro in your formula, do you need to 
reference is as, for example, .ipwithoutmask(D1)?


regards,
Steve



--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros in spreadsheets

2023-01-02 Thread Michael Tiernan

On 12/23/22 11:02 AM, Andrew Pitonyak wrote:

If you are looking to cause functions to recalculate,


Thanks for the reply.

Here's the thing. It's not that I want to force a recalculate, it's that 
I have to in order to get the macros to respond.


Here's an example: (What I expect when the spreadsheet finishes opening.)

/*Cell*//*
*/  /*Contents*//*
*/  /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
192.168.17.231
D3
=ipmask(D1)
255.255.255.0
D4
=ipmasklken(D3)
24

Now, when I actually do open the spreadsheet, it says:

/*Cell*//*
*/  /*Contents*//*
*/  /*Display*//*
*/
D1
192.168.17.231/24
192.168.17.231/24
D2
=ipwithoutmask(D1)
#NAME?
D3
=ipmask(D1)
#NAME?
D4
=ipmasklken(D3)
#NAME?

So, if I say it differently, it *seems* like the Macros aren't run when 
the spreadsheet is opened.


The macro library has a "Main" entry that is empty. If I choose "Tools" 
-> "Macros" -> "Run macro" and then select "Main" and execute it, 
there's no visible change.


BUT, if I go into the contents of "D2" and add a space at the end of the 
formula "=ipwithoutmask(D1)" to read "=ipwithoutmask(D1) " and hit 
return and the macro executes and displays the proper value.


HOWEVER, none of the other cells change so I have to go into each one 
and do the same sort of thing, add a space at the end of the line or 
between the macro and the parenthesis, each time, hit return and it 
works properly.


This is obviously not the correct way it should work.

Hence my query about "starting" macros when the document is opened.

So, that leads to, am *I* doing something wrong?

Thanks for everyone's time.

--
  << MCT >> Michael C Tiernan.http://www.linkedin.com/in/mtiernan 
  Non Impediti Ratione Cogatationis

  Women and cats will do as they please, and men and dogs
   should relax and get used to the idea. -Robert A. Heinlein

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros in spreadsheets

2022-12-23 Thread Andrew Pitonyak
No computer access Right now so everything I say is going to be a guess.

If you are looking to cause functions to recalculate, I think that might be a 
setting not related to macros. Because you can turn off auto recalculation. 
Also, you can force a full update. I know it's on the menu. I don't remember 
the key strokes but I know it's there something like tools recalculator 
something or maybe it's update all I guess

That said, you can associate events to macros. I do believe. I don't do it 
often, but I believe you can. So you can set a macro to run when a document 
opens and maybe that's what you want.

I don't remember offhand how to get to events. You can associate a macro to run 
when an event occurs, but I have done it. I designed some macros for a company 
that wanted things to auto calculate when they opened a template.

For me, learning macros was easier by simply looking at examples and then 
modifying them for my own uses. But you're asking how to cause macros to run 
based on certain conditions, not how do you accomplish a specific task.

Best of luck.

⁣Get BlueMail for Android ​

On Dec 23, 2022, 10:51 AM, at 10:51 AM, Michael Tiernan 
 wrote:
>I have a couple of BASIC macros in a spreadsheet.
>
>I keep thinking that there must be a "init" function that isn't being 
>called because each time I open the spreadsheet, the macros don't run.
>I 
>have to mess about a bit and then force each cell to recalculate 
>manually. (I'm sure that there's a global 'recalculate' button/tool 
>somewhere but that's secondary to the problem.)
>
>I know there's a lot of documentation out there on macros (almost too 
>much) but I'm not sure where to start reading, does anyone have a 
>pointer that would address, not how to create a macro but how to 
>incorporate it to become automatic?
>
>Thanks.
>
>-- 
>   << MCT >> Michael C Tiernan. http://www.linkedin.com/in/mtiernan
>   Non Impediti Ratione Cogatationis
>   Women and cats will do as they please, and men and dogs
>should relax and get used to the idea. -Robert A. Heinlein
>
>
>-- 
>To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
>Problems?
>https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>Posting guidelines + more:
>https://wiki.documentfoundation.org/Netiquette
>List archive: https://listarchives.libreoffice.org/global/users/
>Privacy Policy: https://www.documentfoundation.org/privacy

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


[libreoffice-users] Macros in spreadsheets

2022-12-23 Thread Michael Tiernan

I have a couple of BASIC macros in a spreadsheet.

I keep thinking that there must be a "init" function that isn't being 
called because each time I open the spreadsheet, the macros don't run. I 
have to mess about a bit and then force each cell to recalculate 
manually. (I'm sure that there's a global 'recalculate' button/tool 
somewhere but that's secondary to the problem.)


I know there's a lot of documentation out there on macros (almost too 
much) but I'm not sure where to start reading, does anyone have a 
pointer that would address, not how to create a macro but how to 
incorporate it to become automatic?


Thanks.

--
  << MCT >> Michael C Tiernan. http://www.linkedin.com/in/mtiernan
  Non Impediti Ratione Cogatationis
  Women and cats will do as they please, and men and dogs
   should relax and get used to the idea. -Robert A. Heinlein


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] macros - where stored for Calc

2021-01-10 Thread Michael D. Setzer II
On 10 Jan 2021 at 12:32, Girvin Herr wrote:

Send reply to:  ghe...@fastmail.com
Subject:Re: [libreoffice-users] macros - where stored for Calc
To: users@global.libreoffice.org
From:   Girvin Herr 
Date sent:  Sun, 10 Jan 2021 12:32:04 -0800

> On 1/10/21 3:18 AM, Johnny Rosenberg wrote:
> > Den sön 10 jan. 2021 kl 12:07 skrev Philip Jackson :
> >
> >> On 10/01/2021 08:49, Johnny Rosenberg wrote:
> >>> Den sön 10 jan. 2021 kl 08:35 skrev Tom Cloyd MS MA <
> >>>> tomcloydm...@gmail.com>:
> >>>>> I recently moved my LO user profile to a new computer, but my Calc
> >>>>> macros were not to be found. I had to recreate them. I am about to
> >>>>> repeat this move with another computer. I REALLY want to move my macros
> >>>>> also, but somehow my backups is not catching them.
> >>>>>
> >>>>> Please - where are they stored?
> >>> Here's what I replied:
> >>>> Mine seem to be located at ~/.config/libreoffice/4/user/basic/
> >>>> In ~/.config/libreoffice/4/user/basic/Standard I find my own global
> >>>> macros. They are stored in XML format with file suffixes like xba, xlb,
> >>>> xlc, xdl ...
> >>>> The xdl files are for dialogues, by the way.
> >>>>
> >>>> I'm running Manjaro. I guess it could be slightly different in other
> >>>> operating systems.
> >> My LO templates spent years being in a subdirectory in the
> >> ~/.config/libreoffice/4/user/  structure but after an update (system or
> >> LO, I can't remember now) they all apparently disappeared. Hunting around,
> >> I found them in my home root directory  ~/Templates/
> >>
> > I upgrade relatively often and mine are still in
> > ~/.config/libreoffice/4/user/template/
> > I don't remember if that was also true when I had Ubuntu (I'm on Manjaro
> > since 2016 or so), though.
> >
> >
> > Kind regards
> >
> > Johnny Rosenberg
> >
> >
> >> I don't recall ever having moved them there (but I cannot exclude it 100%)
> >> but it seems as good a place as any.
> >> Philip
> >>
> >>
> >> --
> >> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> >> Problems?
> >> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> >> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> >> List archive: https://listarchives.libreoffice.org/global/users/
> >> Privacy Policy: https://www.documentfoundation.org/privacy
> >>
> Greetings,
> 
> IIRC, the LO default templates directory is in 
> ~/.config/libreoffice/4/user/template Looking at Tools > LibreOffice > 
> Paths will confirm this and it is the place where it can be changed. The 
> Open Desktop standard is in ~/Templates. I added ~/Templates to my LO 
> Templates path with a semicolon separator, so my LO searches both places.
> 
> HTH
> 
> Girvin

In looking at my setup on Fedora System.
Don't know if this matches other setups.
Directory where macros are stored.

/home/msetzerii/.config/libreoffice/4/user/basic/Standard

Files in Directory
-rw-r--r--. 1 msetzerii msetzerii   288 Jun  7  2018 dialog.xlb
-rw-rw-r--. 1 msetzerii msetzerii 18729 Jan  8 22:25 Module1.xba
-rw-rw-r--. 1 msetzerii msetzerii   348 Jan  8 22:25 script.xlb

Now an added question. 
I've made about 40 backup of my macros by doing the following over 
time.
Tools / Macros / Edit
Click on the panel on Right that list the macros
Currently it shows 398 lines.
Do a Ctrl-A to hightlight all lines, and then a Ctrl-C.
Open a text editor, and paste the lines and save as libremacroxx
The Module1.xba file currently has 400 lines in it. 

I've copied the text file to other machines, and just reversed the process 
of pasting the lines into the window, and they seem to transfer just fine.

I also like keeping multiple copies, so I can compare them to see how 
I've made changes over time. Sometimes make a mistake, and having a 
back to be able to restore all or whatever macros. 

Just use the basic setup, so perhaps some have more files.


> 
> 
> 
> -- 
> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> Problems? 
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy


+--

Re: [libreoffice-users] macros - where stored for Calc

2021-01-10 Thread Girvin Herr

On 1/10/21 3:18 AM, Johnny Rosenberg wrote:

Den sön 10 jan. 2021 kl 12:07 skrev Philip Jackson :


On 10/01/2021 08:49, Johnny Rosenberg wrote:

Den sön 10 jan. 2021 kl 08:35 skrev Tom Cloyd MS MA <

tomcloydm...@gmail.com>:

I recently moved my LO user profile to a new computer, but my Calc
macros were not to be found. I had to recreate them. I am about to
repeat this move with another computer. I REALLY want to move my macros
also, but somehow my backups is not catching them.

Please - where are they stored?

Here's what I replied:

Mine seem to be located at ~/.config/libreoffice/4/user/basic/
In ~/.config/libreoffice/4/user/basic/Standard I find my own global
macros. They are stored in XML format with file suffixes like xba, xlb,
xlc, xdl …
The xdl files are for dialogues, by the way.

I'm running Manjaro. I guess it could be slightly different in other
operating systems.

My LO templates spent years being in a subdirectory in the
~/.config/libreoffice/4/user/  structure but after an update (system or
LO, I can't remember now) they all apparently disappeared. Hunting around,
I found them in my home root directory  ~/Templates/


I upgrade relatively often and mine are still in
~/.config/libreoffice/4/user/template/
I don't remember if that was also true when I had Ubuntu (I'm on Manjaro
since 2016 or so), though.


Kind regards

Johnny Rosenberg



I don't recall ever having moved them there (but I cannot exclude it 100%)
but it seems as good a place as any.
Philip


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems?
https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Greetings,

IIRC, the LO default templates directory is in 
~/.config/libreoffice/4/user/template Looking at Tools > LibreOffice > 
Paths will confirm this and it is the place where it can be changed. The 
Open Desktop standard is in ~/Templates. I added ~/Templates to my LO 
Templates path with a semicolon separator, so my LO searches both places.


HTH

Girvin



--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] macros - where stored for Calc

2021-01-10 Thread Johnny Rosenberg
Den sön 10 jan. 2021 kl 12:07 skrev Philip Jackson :

> On 10/01/2021 08:49, Johnny Rosenberg wrote:
> > Den sön 10 jan. 2021 kl 08:35 skrev Tom Cloyd MS MA <
> >> tomcloydm...@gmail.com>:
> >>> I recently moved my LO user profile to a new computer, but my Calc
> >>> macros were not to be found. I had to recreate them. I am about to
> >>> repeat this move with another computer. I REALLY want to move my macros
> >>> also, but somehow my backups is not catching them.
> >>>
> >>> Please - where are they stored?
> > Here's what I replied:
> >> Mine seem to be located at ~/.config/libreoffice/4/user/basic/
> >> In ~/.config/libreoffice/4/user/basic/Standard I find my own global
> >> macros. They are stored in XML format with file suffixes like xba, xlb,
> >> xlc, xdl …
> >> The xdl files are for dialogues, by the way.
> >>
> >> I'm running Manjaro. I guess it could be slightly different in other
> >> operating systems.
>
> My LO templates spent years being in a subdirectory in the
> ~/.config/libreoffice/4/user/  structure but after an update (system or
> LO, I can't remember now) they all apparently disappeared. Hunting around,
> I found them in my home root directory  ~/Templates/
>

I upgrade relatively often and mine are still in
~/.config/libreoffice/4/user/template/
I don't remember if that was also true when I had Ubuntu (I'm on Manjaro
since 2016 or so), though.


Kind regards

Johnny Rosenberg


>
> I don't recall ever having moved them there (but I cannot exclude it 100%)
> but it seems as good a place as any.
> Philip
>
>
> --
> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] macros - where stored for Calc

2021-01-10 Thread Philip Jackson

On 10/01/2021 08:49, Johnny Rosenberg wrote:

Den sön 10 jan. 2021 kl 08:35 skrev Tom Cloyd MS MA <

tomcloydm...@gmail.com>:

I recently moved my LO user profile to a new computer, but my Calc
macros were not to be found. I had to recreate them. I am about to
repeat this move with another computer. I REALLY want to move my macros
also, but somehow my backups is not catching them.

Please - where are they stored?

Here's what I replied:

Mine seem to be located at ~/.config/libreoffice/4/user/basic/
In ~/.config/libreoffice/4/user/basic/Standard I find my own global
macros. They are stored in XML format with file suffixes like xba, xlb,
xlc, xdl …
The xdl files are for dialogues, by the way.

I'm running Manjaro. I guess it could be slightly different in other
operating systems.


My LO templates spent years being in a subdirectory in the
~/.config/libreoffice/4/user/  structure but after an update (system or LO, I 
can't remember now) they all apparently disappeared. Hunting around, I found 
them in my home root directory  ~/Templates/

I don't recall ever having moved them there (but I cannot exclude it 100%) but 
it seems as good a place as any.
Philip


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] macros - where stored for Calc

2021-01-09 Thread Johnny Rosenberg
Ooops, did it again, I sent to the poster instead of the group.
Here it is for the group only.
My apologies.

Den sön 10 jan. 2021 kl 08:46 skrev Johnny Rosenberg :

> Den sön 10 jan. 2021 kl 08:35 skrev Tom Cloyd MS MA <
> tomcloydm...@gmail.com>:
>
>> I recently moved my LO user profile to a new computer, but my Calc
>> macros were not to be found. I had to recreate them. I am about to
>> repeat this move with another computer. I REALLY want to move my macros
>> also, but somehow my backups is not catching them.
>>
>> Please - where are they stored?
>>
>
>
Here's what I replied:


> Mine seem to be located at ~/.config/libreoffice/4/user/basic/
> In ~/.config/libreoffice/4/user/basic/Standard I find my own global
> macros. They are stored in XML format with file suffixes like xba, xlb,
> xlc, xdl …
> The xdl files are for dialogues, by the way.
>
> I'm running Manjaro. I guess it could be slightly different in other
> operating systems.
>
> Kind regards
>
> Johnny Rosenberg
>
>
End of reply.


>> t.
>>
>>
>> --
>>
>>
>> ~
>> "Fight for the things that you care about, but do it in a way that will
>> lead
>> others to join you." ~ Ruth Bader Ginsberg
>>
>> ~
>> Tom Cloyd, MS MA | t...@tomcloyd.com
>> Psychological trauma & dissociative disorders research & advocacy
>> Spokane, Washington, U.S.A. | (435) 272-3332
>> Facebook: https://www.facebook.com/groups/645665272216298/
>>
>> ~
>> Acer Spin 5 / 15.4GB RAM / 512GB SSD
>> Operating System: Fedora 33 (Linux) / KDE Plasma Version: 5.20.3
>> KDE Frameworks Version: 5.75.0 / Qt Version: 5.15.2
>> Kernel Version: 5.9.11-200.fc33.x86_64
>> Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
>> Graphics Processor: Mesa Intel® Iris® Plus Graphics
>>
>>
>> --
>> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
>> Problems?
>> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
>> List archive: https://listarchives.libreoffice.org/global/users/
>> Privacy Policy: https://www.documentfoundation.org/privacy
>>
>

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


[libreoffice-users] macros - where stored for Calc

2021-01-09 Thread Tom Cloyd MS MA
I recently moved my LO user profile to a new computer, but my Calc 
macros were not to be found. I had to recreate them. I am about to 
repeat this move with another computer. I REALLY want to move my macros 
also, but somehow my backups is not catching them.


Please - where are they stored?

t.


--

~
"Fight for the things that you care about, but do it in a way that will lead
others to join you." ~ Ruth Bader Ginsberg
~
Tom Cloyd, MS MA | t...@tomcloyd.com
Psychological trauma & dissociative disorders research & advocacy
Spokane, Washington, U.S.A. | (435) 272-3332
Facebook: https://www.facebook.com/groups/645665272216298/
~
Acer Spin 5 / 15.4GB RAM / 512GB SSD
Operating System: Fedora 33 (Linux) / KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.75.0 / Qt Version: 5.15.2
Kernel Version: 5.9.11-200.fc33.x86_64
Processors: 8 × Intel® Core™ i7-1065G7 CPU @ 1.30GHz
Graphics Processor: Mesa Intel® Iris® Plus Graphics


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy


Re: [libreoffice-users] Macros : For Each Cell in LibreOffice Basic ?

2018-01-23 Thread Andrew Pitonyak
I remember writing code to go through cells... I don't remember if it was in 
AndrewMacro.odt or OOME.odt...

Can't look it up now...

Much depends on things like sizes and what you want to compare

Coming off a long shift, need to sleep, if you can't find it, let me know.

⁣Sent from BlueMail ​

On Jan 23, 2018, 6:45 AM, at 6:45 AM, stgmdn  wrote:
>Hello,
>
>I have to create a macro that read through a defined cell range, and
>for
>each cell, will assign it to a variable (to compare it to another
>cell),
>then it goes on the next cell.
>
>In my researches, I found that we can do this with a For Each Cell in
>VBA
>for Excel, but i can't seem to find the code that would do the same
>thing in
>LibreOffice Basic.
>
>Hope I've been clear enough, and thanks for your help.
>
>
>
>--
>Sent from: http://nabble.documentfoundation.org/Users-f1639498.html
>
>--
>To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
>Problems?
>https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
>Posting guidelines + more:
>https://wiki.documentfoundation.org/Netiquette
>List archive: https://listarchives.libreoffice.org/global/users/
>All messages sent to this list will be publicly archived and cannot be
>deleted

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] Macros : For Each Cell in LibreOffice Basic ?

2018-01-23 Thread Jean-Francois Nifenecker

Hi Tom,

Le 23/01/2018 à 09:35, stgmdn a écrit :


I have to create a macro that read through a defined cell range, and for
each cell, will assign it to a variable (to compare it to another cell),
then it goes on the next cell.

In my researches, I found that we can do this with a For Each Cell in VBA
for Excel, but i can't seem to find the code that would do the same thing in
LibreOffice Basic.



Yes, you're clear :)

I can see two ways to achieve your goal :
1. Browsing the cell range
2. Browsing the cell range data

1. Browsing a cell range

You have to create an enumerator which will give you the means to browse 
the range. The enumerator cannot be directly created from the range: 
you'll need a "range of ranges" (see below) in which you insert the 
range to browse object.


8< --
Dim MyRanges As Object  'a range of ranges
Dim MyEnum   As Object  'the enumerator
Dim TheCell  As Object  'each of the individual cells

MyRanges = 
ThisComponent.createInstance("com.sun.star.sheet.SheetCellRanges")

MyRanges.insertByName("some arbitrary name", MyRangeToBrowse)
MyEnum = MyRanges.Cells.CreateEnumeration
Do While MyEnum.hasMoreElements
TheCell = MyEnum.NextElement
'do smthg with the cell object
Loop
-- >8

Note that empty cells in the range will NOT be made avalaible (they are 
skipped by the enumerator).



2. Browsing cell range data

Once you've got the range to browse object, just refer to its .DataArray 
property and play with it. You'll have to use an external array as a buffer.


8< --
Dim MyArray As Variant  'buffer array

MyArray = MyRangeToBrowse.DataArray 'MyArray is set according to the 
range dimensions


'do smthg with the array items
'and finish with:
MyRangeToBrowse.DataArray = MyArray
-- >8

Note that the .DataArray property (thus MyArray as well) is a nested 
array : items are referred to as MyArray(i)(j), NOT as MyArray(i, j)



HTH,
--
Jean-Francois Nifenecker, Bordeaux


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Macros : For Each Cell in LibreOffice Basic ?

2018-01-23 Thread stgmdn
Hello, 

I have to create a macro that read through a defined cell range, and for
each cell, will assign it to a variable (to compare it to another cell),
then it goes on the next cell.

In my researches, I found that we can do this with a For Each Cell in VBA
for Excel, but i can't seem to find the code that would do the same thing in
LibreOffice Basic.

Hope I've been clear enough, and thanks for your help.



--
Sent from: http://nabble.documentfoundation.org/Users-f1639498.html

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Macros : How to solve concurrency/Reentrancy in events procedures ?

2018-01-12 Thread Patrick Gelin

Hi,

I'm using LibreOffice 5.2.7.2 with HSQLDB database server (not embeded).

I've got a problem with form events management, so I'm looking best 
practice to manage reantrancy :


1) I'm asking myself if each event is a different trhead ?

2) Do you know sample of code with uno API to manage Mutex 
 in Thread that I 
could use with Basic macros ? I couldn't find anything like this into 
"Marcelyy, B., Godard, L. - Programmation OpenOffice.org 3 - Eyrolles, 
2009" Do you know a other book more closer with Uni APIs ?


3) Is it possible to replace default Form listners by handlers, in order 
to refuse reantrancy by rejecting unecessary events ?


4) Do I prefer modify the default Form controler in order to manage at 
source level the reantrancy problem ? Do you sample of code to do?


5) Is it possible to write a mutex by home, I could use into my Forms 
listners ? For exemple, using a global variable as counter events and a 
wait() call to manage priorities ...


By the way, I noticed in my macro a global variable instanciated into 
one of my form listner may disappear... I was reading into "Useful Macro 
Information For OpenOffice.org By Andrew Pitonyak (p.373) 
" 
that controlers may be replaced by others ones, and listners detached... 
So I'm asking myself if there is something similar explaining my 
problem. But I'm only moving from one record to next one, and my 
variable is global ...


Thank you for your help !

Patrick


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] Macros : ByVal doesn't work with parameters in a class object modul ...

2018-01-08 Thread Jean-Francois Nifenecker

Hi Patrick,

Le 06/01/2018 à 10:58, Patrick Gelin a écrit :


Below is a complet macro to manage Vectors of variants (With french
coments) . I've got a problem with unitary test (Cf. Sub Main) because
call to procedure 'v.Ajouter(duolet)' use always passage by reference
instead of a passage by value (ByVal) ! For all that, I delicately
manage a passage by value in my function...

I tested with a call to New operator in order to build specifics
instances at each call, like this :

duolet = new __TDuolet
duolet.key = "MONTAGNE"
duolet.Item = 3
v.Ajouter(duolet)

And it's fine, the duolet variable is a new one instance. But I don't
want the caller do all this stuff. I would like easier way to do ...



This
v.Ajouter(ByVal duolet)
won't do. The ByVal specifier is only present at the declaration level, 
not the calling one.



You could just add a CreateDuolet() function to create the Duolets, like 
this :


Function CreateDuolet(ByRef pKey As String, pItem As Variant) As __TDuolet

Dim MyDuolet As __TDuolet

MyDuolet.key = pKey
MyDuolet.item = pItem

CreateDuolet = MyDuolet

End Function

(note : this function is not a class member)

Then, the caller has just to specify:

duolet = CreateDuolet("MONTAGNE", 3)
v.Ajouter(duolet)

or you might also simply call
v.Ajouter(CreateDuolet("MONTAGNE", 3))


BTW, I've noticed some glitches elsewhere, eg: in the _Expend() method, 
you've declared isPresserved as Optional but never test for its presence 
or not in the method body. This might lead to strange results, don't you 
think?

[BTW, BTW, shouldn't the method be called "_Expand" instead of "_Expend"?]


HTH,
--
Jean-Francois Nifenecker, Bordeaux


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Macros : ByVal doesn't work with parameters in a class object modul ...

2018-01-06 Thread Patrick Gelin

Hi,

I'm using Libreoffice :

Version: 5.2.7.2
Build ID: 1:5.2.7-1
Threads CPU : 2; Version de l'OS :Linux 4.12; UI Render : par défaut; 
VCL : gtk3;

Locale : fr-FR (fr_FR.UTF-8); Calc: group

Below is a complet macro to manage Vectors of variants (With french 
coments) . I've got a problem with unitary test (Cf. Sub Main) because 
call to procedure 'v.Ajouter(duolet)' use always passage by reference 
instead of a passage by value (ByVal) ! For all that, I delicately 
manage a passage by value in my function...


I tested with a call to New operator in order to build specifics 
instances at each call, like this :


duolet = new __TDuolet
duolet.key = "MONTAGNE"
duolet.Item = 3 
v.Ajouter(duolet)

And it's fine, the duolet variable is a new one instance. But I don't 
want the caller do all this stuff. I would like easier way to do ...


I'm asking myself if it's a specific bug to my LibreOffice versin, or 
with Variants and Struct type (__TDuolet) ?


What do you think about that ? What can I do to copy by val the 
parameter into my function v.Ajouter(duolet) ?


Think you for your help...

Patrick

PS: Macro is below, it's a draft ...

---

REM  *  BASIC  *
Option Compatible
Option ClassModule

Option Explicit

Type __TDuolet
key As String   'l'etiquette de l'objet
item As Variant 'un objet quelconque
End Type

Private _Items As Variant
Private _n As Long
Private _Titre As String
Private _StepSize As Long

' #PROCEDURE# ==
' Name...: Class_Initialize
' Description ...:
' Parameters :
' Syntax : Class_Initialize
' Return values .: Success - void
'  Failure - sets @error
' Author : Patrick GELIN
' Modified...:
' Remarks ...:
' Related ...:
' Link ..:
' Example ...:
Private Sub Class_Initialize()
_n = 0
_Titre = Name
_StepSize = 30
_Items = DimArray(_StepSize+1)  
End Sub

' #PROCEDURE# ==
' Name...: Class_Terminate
' Description ...:
' Parameters :
' Syntax : Class_Terminate
' Return values .: Success - void
'  Failure - sets @error
' Author : Patrick GELIN
' Modified...:
' Remarks ...:
' Related ...:
' Link ..:
' Example ...:
Private Sub Class_Terminate()
End Sub

Rem ***
Rem
Rem PROPRIETES
Rem
Rem ***
Public Property Let Titre(unTitre As String)
_Titre  = unTitre
End Property

Public Property Get Titre As String
Titre  = _Titre
End Property

Public Property Get AllItems As Variant
AllItems = _Items
End Property

Public Property Let StepSize(ByVal delta As Long)
_StepSize  = delta
End Property

Public Property Get StepSize As Long
StepSize = _StepSize
End Property

Public Property Get NbElements As Long
NbElements = _n
End Property

Public Property Get Taille As Long
Taille = UBound(_Items) - LBound(_Items) + 1
End Property

Public Property Get UBound As Long
UBound(_Items)
End Property

Public Property Get LBound As Long
LBound(_Items)
End Property

Rem ***
Rem
Rem METHODES PRIVEES
Rem
Rem ***
Public Sub _Expend(Optional StepSize As Long, Optional isPresserved As Boolean 
= True)

Dim IndexMax As Long

If IsMissing(StepSize) Then StepSize = _StepSize
IndexMax = UBound(_Items()) + StepSize
If isPresserved Then
Redim Preserve _Items(IndexMax) As Variant
Else
Redim _Items(IndexMax) As Variant
EndIf
End Sub


Rem ***
Rem
Rem METHODES PUBLIQUES
Rem
Rem ***
' #PROCEDURE# ==
' Name...: Ajouter
' Description ...: Ajouter un variant au vecteur.
' Parameters : Item (variant) : Un variant au vecteur.
' Syntax : Ajouter(Item)
' Return values .: N/A
' Author : Patrick GELIN
' Modified...: 06/01/2018
' Remarks ...: ATTENTION : L'attribut ByVal ne fonctionne pas !
'Le parametre Item doit donc avoir une 
instance spécifique,
'sans réutiliser l'instance d'un autre 
Item déjà ajouté au vecteur
'sinon ce premier aura la valeur de la 
dernière modification !
' Related ...:
' Link ..:
' Example ...:
Public Sub Ajouter(ByVal 

Re: [libreoffice-users] [macros] How to create a timer ?

2017-07-21 Thread Mauricio Baeza Servin
On Fri, 21 Jul 2017 22:54:08 +0200, Jean-Francois Nifenecker 
 wrote:

> Maurizio, Andrew,
> 
> thanks for the pointers you posted. This will help me finding out.
> I guess the "simplest" way would be to call a Python script from Basic.
> 
> Thanks again to both of you. You've put me on the way.
> Greetings from the other side of the pond,
> -- 
> Jean-Francois Nifenecker, Bordeaux
> 

Hello again...

Yes, for call Python script from Basic, EasyDev it's your friend: 
http://easydev.readthedocs.io/en/latest/tools.html#call-macros

If you need some special functionality, I can add to EasyDev.

Best regards
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] [macros] How to create a timer ?

2017-07-21 Thread Jean-Francois Nifenecker

Maurizio, Andrew,

thanks for the pointers you posted. This will help me finding out.
I guess the "simplest" way would be to call a Python script from Basic.

Thanks again to both of you. You've put me on the way.
Greetings from the other side of the pond,
--
Jean-Francois Nifenecker, Bordeaux


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] [macros] How to create a timer ?

2017-07-21 Thread Andrew Pitonyak

On 2017-07-21 11:30, Jean-Francois Nifenecker wrote:

All,

I'm looking for a way to create a timer in LibO Basic as a reminder
to accomplish some task.


The timer would be started when the document is opened, then would
send a message to the user if he has not accomplished a particular
task (eg validating a particular dialog) when a delay expires (eg 2
hrs).

In fact I'm in need of several timers for the same document to handle
as many different delays/tasks.


Can anyone point me to some direction as I'm currently in the dark?


Thanks in advance.
Best regards,
--
Jean-Francois Nifenecker, Bordeaux



My gut reaction is that this is not directly supported in Basic.

That said, read these posts:

https://forum.openoffice.org/en/forum/viewtopic.php?f=44=59369

https://forum.openoffice.org/en/forum/viewtopic.php?f=9=33935

Sadly, this post references something implemented in BeanShell that 
would have helped, but it references a now defunct forum with the 
solution (so when they say that MS777 developed a solution and provides 
a link, that link is no longer valid).


http://ooo-forums.apache.org/en/forum/viewtopic.php?t=65864=292463




--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] [macros] How to create a timer ?

2017-07-21 Thread Mauricio Baeza Servin
On Fri, 21 Jul 2017 17:30:26 +0200, Jean-Francois Nifenecker 
 wrote:

> All,
> 
> I'm looking for a way to create a timer in LibO Basic as a reminder to 
> accomplish some task.
> 
> 
> The timer would be started when the document is opened, then would send 
> a message to the user if he has not accomplished a particular task (eg 
> validating a particular dialog) when a delay expires (eg 2 hrs).
> 
> In fact I'm in need of several timers for the same document to handle as 
> many different delays/tasks.
> 
> 
> Can anyone point me to some direction as I'm currently in the dark?
> 
> 
> Thanks in advance.
> Best regards,
> -- 
> Jean-Francois Nifenecker, Bordeaux
> 


Hi...

You can used EasyDev: http://easydev.readthedocs.io/en/latest/tools.html#timer

Best regards
-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] [macros] How to create a timer ?

2017-07-21 Thread Jean-Francois Nifenecker

All,

I'm looking for a way to create a timer in LibO Basic as a reminder to 
accomplish some task.



The timer would be started when the document is opened, then would send 
a message to the user if he has not accomplished a particular task (eg 
validating a particular dialog) when a delay expires (eg 2 hrs).


In fact I'm in need of several timers for the same document to handle as 
many different delays/tasks.



Can anyone point me to some direction as I'm currently in the dark?


Thanks in advance.
Best regards,
--
Jean-Francois Nifenecker, Bordeaux


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


[libreoffice-users] Macros Guides - Re: Programming guide for LibreOffice 4.1

2016-03-07 Thread LibreTraining
Andrew D. Pitonyak - OpenOffice.org Macro Information page
http://www.pitonyak.org/oo.php   

OpenOffice.org Macros Explained - 3rd.Edition - June 12, 2015 - by Andrew D.
Pitonyak  (PDF, 8.5 MB)
http://www.pitonyak.org/OOME_3_0.pdf   

Useful Macro Information for OpenOffice.org - Nov. 6, 2007 - by Andrew D.
Pitonyak  (PDF, 2.5 MB)
http://www.pitonyak.org/AndrewMacro.pdf
  

Those two PDFs are the best resources I have found for LibreOffice macro
programming.





--
View this message in context: 
http://nabble.documentfoundation.org/Programming-guide-for-LibreOffice-4-1-tp4177760p4177835.html
Sent from the Users mailing list archive at Nabble.com.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Macros [or perhaps not] in Libre Calc

2014-06-10 Thread Tom Davies
Hi :)
That might be a better route!

The database route might be better if the wide-eyed-end-users were going to
enter the data directly onto a computer such as a hand-held device or
tablet or something.  Sadly LIbreOffice does not yet work on hand-held
devices but AndrOO does but i'm not sure if the Base component is included.
 So the weeus might have to use a desktop machine for it.


I didn't quite follow Brian's instructions but that might be because i've
got a fever and only read it hastily.  Writer does sound like a good module
to use.  I'm guessing that each module would have different advantages.


I had a quick stab at doing this in Calc but just on a single worksheet to
try to take advantage of the auto-increment feature but it didn't work well
when there was a gap between the dates.  Using multiple sheets didn't seem
likely to work either.

I also had a quick go at creating a copy of the file, renaming the
file-ending to zip and then editing the contents.xml.  It kinda worked
with minimal info on each page but i could imagine it become hideously
turgid with even a little more information on the pages.

Regards from
Tom :)




On 10 June 2014 06:34, Brian Barker b.m.bar...@btinternet.com wrote:

 At 23:24 09/06/2014 +0100, Philip Ward wrote:

 basically what i'm after is... A cleaning/HSE Check sheet, that gets
 printed out, and the staff fill it out, ie tick the boxes, say what's gone
 of in that day etc. i have laid out a sheet, over 2 pages, and the only
 thing that i want to basically do is print out 365 (or obviously a leap
 year 366) page document, and automatically add a new date to the printed
 sheet for that.


 So you want a 365-page document with identical text on each page except
 that each page has somewhere on it a sequential date?

  i didn't want to copy and paste the same thing 365 times, for 4 or 5
 times, as there are different parts of the business, ie Cafe/Bar/Icecream
 kiosk etc, which all need their individual style/setup.


 You wouldn't in any case have to do that.
 o Create Sheet 1 with the first date.
 o Create Sheet 2 calculating its date from Sheet1.
 o Copy Sheet 2 to a new third sheet.
 o Select sheets 2 and 3 and copy them to the end position. You now have
 five sheets.
 o Select sheets 2 to 5 and copy them to the end position. You now have
 nine sheets.
 o Repeat this copying process a further six times. You now have 513 sheets
 - more than a year's worth; delete the excess.

  i was looking for a quick way to copy the sheet, add a new sheet, paste
 it, then do the same thing over and over again. On the second sheet i know
 i can make a date = Previous sheet/Cell and +1 to it, and this would be the
 one that's copied all the rest of the year, but that's about where my
 knowledge on libre finishes (having brought most of what i knew from
 excel), ...


 Since what you want on each page is presumably text, perhaps set in boxes
 and so on, surely the whole project is better done in a text (Writer)
 document - where you can easily create documents of 366 pages. Writer
 tables are very flexible and will enable you to set out the text as you
 wish.

 But how to create your varying date? Well, Writer provides variables to
 help you. I'm no expert in these, but I've just learned enough in perhaps
 fifteen minutes to be able to create a 365-page document with identical
 dummy text on each page but also including text running from 1 Jan 2014
 to 31 Dec 2014.

 o With the cursor at the beginning of the first page, go to Insert |
 Fields  | Other... | Variables. Choose Set variable, and give your
 variable a name (vdate?) and an appropriate value. I wanted to start at
 31 Dec 2013, but I couldn't see how to enter this directly as a date. With
 the help of Calc, I quickly found the value I needed was 41639. Tick
 Invisible and click Insert.

 o With the cursor where you want your date to appear, repeat the above,
 again choosing Set variable, selecting your variable name, but then
 inserting the appropriate expression - vdate+1 - in the Value box. Before
 clicking Insert, select an appropriate format (date formats are hidden
 behind Additional formats...) and ensure Invisible is *not* ticked. You
 now see your first date: 1 Jan 2014.

 o Copy the material to a second page, carefully avoiding copying the
 invisible starting value. The copied date magically becomes 2 Jan 2014.

 o Copy pages repeatedly as for the spreadsheet case, always omitting the
 first page, so as again to avoid the invisible starting value. After a
 total of ten copying actions you will have 513 separately dated pages -
 nearly seventeen months' worth. Delete the excess.

 I trust this helps.

 Brian Barker


 --
 To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
 Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-
 unsubscribe/
 Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All 

Re: [libreoffice-users] Macros [or perhaps not] in Libre Calc

2014-06-09 Thread Brian Barker

At 23:24 09/06/2014 +0100, Philip Ward wrote:
basically what i'm after is... A cleaning/HSE Check sheet, that gets 
printed out, and the staff fill it out, ie tick the boxes, say 
what's gone of in that day etc. i have laid out a sheet, over 2 
pages, and the only thing that i want to basically do is print out 
365 (or obviously a leap year 366) page document, and automatically 
add a new date to the printed sheet for that.


So you want a 365-page document with identical text on each page 
except that each page has somewhere on it a sequential date?


i didn't want to copy and paste the same thing 365 times, for 4 or 5 
times, as there are different parts of the business, ie 
Cafe/Bar/Icecream kiosk etc, which all need their individual style/setup.


You wouldn't in any case have to do that.
o Create Sheet 1 with the first date.
o Create Sheet 2 calculating its date from Sheet1.
o Copy Sheet 2 to a new third sheet.
o Select sheets 2 and 3 and copy them to the end position. You now 
have five sheets.
o Select sheets 2 to 5 and copy them to the end position. You now 
have nine sheets.
o Repeat this copying process a further six times. You now have 513 
sheets - more than a year's worth; delete the excess.


i was looking for a quick way to copy the sheet, add a new sheet, 
paste it, then do the same thing over and over again. On the second 
sheet i know i can make a date = Previous sheet/Cell and +1 to it, 
and this would be the one that's copied all the rest of the year, 
but that's about where my knowledge on libre finishes (having 
brought most of what i knew from excel), ...


Since what you want on each page is presumably text, perhaps set in 
boxes and so on, surely the whole project is better done in a text 
(Writer) document - where you can easily create documents of 366 
pages. Writer tables are very flexible and will enable you to set out 
the text as you wish.


But how to create your varying date? Well, Writer provides 
variables to help you. I'm no expert in these, but I've just 
learned enough in perhaps fifteen minutes to be able to create a 
365-page document with identical dummy text on each page but also 
including text running from 1 Jan 2014 to 31 Dec 2014.


o With the cursor at the beginning of the first page, go to Insert | 
Fields  | Other... | Variables. Choose Set variable, and give your 
variable a name (vdate?) and an appropriate value. I wanted to 
start at 31 Dec 2013, but I couldn't see how to enter this directly 
as a date. With the help of Calc, I quickly found the value I needed 
was 41639. Tick Invisible and click Insert.


o With the cursor where you want your date to appear, repeat the 
above, again choosing Set variable, selecting your variable name, 
but then inserting the appropriate expression - vdate+1 - in the 
Value box. Before clicking Insert, select an appropriate format (date 
formats are hidden behind Additional formats...) and ensure 
Invisible is *not* ticked. You now see your first date: 1 Jan 2014.


o Copy the material to a second page, carefully avoiding copying the 
invisible starting value. The copied date magically becomes 2 Jan 2014.


o Copy pages repeatedly as for the spreadsheet case, always omitting 
the first page, so as again to avoid the invisible starting value. 
After a total of ten copying actions you will have 513 separately 
dated pages - nearly seventeen months' worth. Delete the excess.


I trust this helps.

Brian Barker


--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Macros in templates

2013-07-14 Thread Graham Luffrum
I am using LO version 4.0.4.2 under Windows 7 and have a number of
spreadsheets with macros in them.  My macro security settings are set so
that I am always asked if I want to open them with or without the macros
and this happens.  I would like to set these spreadsheets as templates.
This I have tried to do, but when I open a new spreadsheet based on one of
these templates, the macros are blocked and when I try to run them I am
told to look at my security settings.  I have tried to find a security
setting that relates to macros in templates, but without success.

I am missing something?

By the way, in my previous version of LO (3.5 something) it worked, i.e.
when I created a new spreadsheets from the templates I was asked what I
wanted to do with the macros.

-- 
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



off-list Re: [libreoffice-users] Macros don't run

2013-03-09 Thread Tom Davies
Hi :)
Lol, i was going to ask that! :)  

Reminds me of the story of the Cambridge Maths Lecturer that at the beginning 
of 1 term wrote on blackboard
It is obvious that ...
then paused and looked at the board, then at his chalk, then back at his notes 
and back at the board again and then just walked out the room leaving all the 
students wondering wtf was going on.  


The next week they arrived to find a note on the lecture halls door saying the 
lecture had been postponed.  Same thing the week after and the week after that. 
 On the 5th week they arrived to find the professor waiting and he wrote on the 
board 

It IS obvious that ... 


Regards from
Tom :)  






 From: Andrew Douglas Pitonyak and...@pitonyak.org
To: users@global.libreoffice.org 
Sent: Saturday, 9 March 2013, 5:45
Subject: Re: [libreoffice-users] Macros don't run
 
Does that mean that you have solved your problem / answered your own 
question?

On 03/07/2013 08:39 AM, Malcolm Moore wrote:
 I think I may have sussed this one


 Ta


 M

    _
 From: Malcolm Moore [mailto:st-malcolm.mo...@whsg.info]
 To: users@global.libreoffice.org
 Sent: Thu, 07 Mar 2013 12:18:30 +
 Subject: [libreoffice-users] Macros don't run

 If you have a macro assigned to a button in calc where there is only one 
 sheet it works
 If calc has lots of sheets the macro doesn't run. Do I need to tell the 
 macro which sheet
 it should be running on somehow


 Ta


 M


-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted




-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Macros don't run

2013-03-07 Thread Malcolm Moore
If you have a macro assigned to a button in calc where there is only one sheet 
it works
If calc has lots of sheets the macro doesn't run. Do I need to tell the macro 
which sheet 
it should be running on somehow


Ta


M

-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Macros - Basic Documentation

2012-02-23 Thread Tom Davies
Hi :)

Did you get any good answers to this one or solve it on your own?  If not then 
now might be a good time to ask the list or find the new askBOT thing on the 
official LibreOffice website and ask afresh there

Sorry i can't help!

Apols and regards from
Tom :)

--- On Sun, 19/2/12, Nicolás Adamo nicoad...@gmail.com wrote:

From: Nicolás Adamo nicoad...@gmail.com
Subject: [libreoffice-users] Macros - Basic Documentation
To: users@global.libreoffice.org
Date: Sunday, 19 February, 2012, 19:10

Hello people! I'm finding it very hard to get help on Macro's Basic
instructions... For example, I want to find out how to copy
spreadsheets with macros. I turn on the record, copy some sheet and
then see the instructions used:

Dim ...
Dim ...
x(0)=...
[etc]
dispatcher.executeDispatch(document, .uno:Move, , 0, args1())
End Sub
---

Very Good! Now I know the instruction is a dispatcher with URL/Command .uno:Move
If I place the cursor over .uno:move and press F1, help comes out
with subject not found. Ok, building the documentation for all the
instructions is hard work no one has the time to accomplish it.
Let's see the internet... There's api.libreoffice.com , which at first
glance seems sooo helpful. Articles have a lot of links to more
articles, etc. If I start browsing, one thing leads to another and
then I'm lost. I see no search box so I return to the main page.
There's a google box, so I write .uno:move  . There are plenty of
results, no one describing how to move/copy a sheet. Google didn't
realize I wanted the whole phrase, so I put double quotes
.uno:move... and nothing... Am I missing something?? I gave
google.com a try with the phrase, but the only interesting result is a
forum discussion. Is helpful, but my point is: Where the heck is the
precise description of the instruction .uno:move ?? What are it's
arguments??
Andrew Pytoniak wrote very good books and collections of forum
questions regarding to macros, but when you have a certain doubt,
where do you seek for help??
I really love Libreoffice, just suffered the luck of a clear way to
get help on macros.

Regards,

Nicolás

-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Macros - Basic Documentation

2012-02-23 Thread Nicolás Adamo


On 02/23/2012 04:37 PM, Tom Davies wrote:

Hi :)

Did you get any good answers to this one or solve it on your own?  If not then 
now might be a good time to ask the list or find the new askBOT thing on the 
official LibreOffice website and ask afresh there
I found this interesting link exposing all the things I've already 
suffered: 
http://user.services.openoffice.org/en/forum/viewtopic.php?f=20t=48076
I think It will be a great challenge to create an online help for 
macros, which would be bundled to LO's help, but I don't think it will 
come soon.
Sad to find out another weakpoint in free software (the other one is CAD 
software, and a little far away is the lack of some drivers for linux).
My point is not the lack of software, but the hard learning curve and 
thus the difficult to make the available tools productive for most users.

Hope someday things change... And also hope I'll be part of the change :)
Regards,

Nicolás

--
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



[libreoffice-users] Macros - Basic Documentation

2012-02-19 Thread Nicolás Adamo
Hello people! I'm finding it very hard to get help on Macro's Basic
instructions... For example, I want to find out how to copy
spreadsheets with macros. I turn on the record, copy some sheet and
then see the instructions used:

Dim ...
Dim ...
x(0)=...
[etc]
dispatcher.executeDispatch(document, .uno:Move, , 0, args1())
End Sub
---

Very Good! Now I know the instruction is a dispatcher with URL/Command .uno:Move
If I place the cursor over .uno:move and press F1, help comes out
with subject not found. Ok, building the documentation for all the
instructions is hard work no one has the time to accomplish it.
Let's see the internet... There's api.libreoffice.com , which at first
glance seems sooo helpful. Articles have a lot of links to more
articles, etc. If I start browsing, one thing leads to another and
then I'm lost. I see no search box so I return to the main page.
There's a google box, so I write .uno:move  . There are plenty of
results, no one describing how to move/copy a sheet. Google didn't
realize I wanted the whole phrase, so I put double quotes
.uno:move... and nothing... Am I missing something?? I gave
google.com a try with the phrase, but the only interesting result is a
forum discussion. Is helpful, but my point is: Where the heck is the
precise description of the instruction .uno:move ?? What are it's
arguments??
Andrew Pytoniak wrote very good books and collections of forum
questions regarding to macros, but when you have a certain doubt,
where do you seek for help??
I really love Libreoffice, just suffered the luck of a clear way to
get help on macros.

Regards,

Nicolás

-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted



Re: [libreoffice-users] Macros - Basic Documentation

2012-02-19 Thread Johnny Rosenberg
2012/2/19 Nicolás Adamo nicoad...@gmail.com:
 Hello people! I'm finding it very hard to get help on Macro's Basic
 instructions... For example, I want to find out how to copy
 spreadsheets with macros. I turn on the record, copy some sheet and
 then see the instructions used:

Just don't never ever use the macro recorder. It's crap and will never
be anything else.
There is an alternative macro recorder somewhere to install that is
slightly better, but the best thing to do (as far as I know) is to
install (and use) xray and learn from others, maybe
http://www.pitonyak.org/oo.php could be a good start.


Kind regards

Johnny Rosenberg
ジョニー・ローゼンバーグ

 
 Dim ...
 Dim ...
 x(0)=...
 [etc]
 dispatcher.executeDispatch(document, .uno:Move, , 0, args1())
 End Sub
 ---

 Very Good! Now I know the instruction is a dispatcher with URL/Command 
 .uno:Move
 If I place the cursor over .uno:move and press F1, help comes out
 with subject not found. Ok, building the documentation for all the
 instructions is hard work no one has the time to accomplish it.
 Let's see the internet... There's api.libreoffice.com , which at first
 glance seems sooo helpful. Articles have a lot of links to more
 articles, etc. If I start browsing, one thing leads to another and
 then I'm lost. I see no search box so I return to the main page.
 There's a google box, so I write .uno:move  . There are plenty of
 results, no one describing how to move/copy a sheet. Google didn't
 realize I wanted the whole phrase, so I put double quotes
 .uno:move... and nothing... Am I missing something?? I gave
 google.com a try with the phrase, but the only interesting result is a
 forum discussion. Is helpful, but my point is: Where the heck is the
 precise description of the instruction .uno:move ?? What are it's
 arguments??
 Andrew Pytoniak wrote very good books and collections of forum
 questions regarding to macros, but when you have a certain doubt,
 where do you seek for help??
 I really love Libreoffice, just suffered the luck of a clear way to
 get help on macros.

 Regards,

 Nicolás

 --
 For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
 Problems? 
 http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
 Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All messages sent to this list will be publicly archived and cannot be deleted


-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted


Re: [libreoffice-users] Macros

2011-10-30 Thread Andrew Pitonyak

Spotty access to email and short on time 

The included help does not include API level documentation since most
people have no need for it.

Sadly, I have no ability at the moment to generate an example, but, you
can find numerous examples in AndrewMacro.odt for this. I believe that
there will be a better explanation in OOME as available on my web site. If
you download that and it does not yet contain Calc examples, shoot me a
private email and I will push a copy that (although incomplete) will
contain an example of how this is done. 

In brief, the idea is that you:

1. Obtain a reference to the document. If it is the current document, then
you can use the variable ThisComponent.

2. Get a reference to the sheet containing the cell. In most cases, you
can do something like the following:

ThisComponent.sheets.getByIndex(0)  ' Get the first sheet
ThisComponent.sheets.getByName(Investments) ' Get a sheet by name

Sometimes you simply want to get the currently active sheet, which is a
bit more difficult. It probably looks something like the follow (from
memory so I am probably wrong).

ThisComponent.CurrentController.ActiveSheet

After you have the sheet, then you can get the cell. Again, this is all
from memory, so I am likely totally wrong, but it probably looks something
like:

oSheet.getCellByPosition(1,2) 'Cell B3
oSheet.getCellRangeByName(B3)

A cell range with a single cell returns that cell I believe.

Next, you must decide how to get the contents of the cell. Do you want the
contained formula, a numeric value, or a string representation? 

Oh, and David, I copied you with a BCC because I do not know if my post to
the list will go through based on the credentials used to send this email.

Andrew Pitonyak

On Sun, 30 Oct 2011 11:13:40 + (GMT), Tom Davies
tomdavie...@yahoo.co.uk wrote:
 Hi :)
 There are various books and guides about Macros.  I've been told by
 various people that Andrew Pitonyak's is excellent.  Hopefully the link
is
 on this page
 http://wiki.documentfoundation.org/Documentation/Publications
 
 I'm not sure if that will help with the specific problem as we might
need
 to collect links to more external resources onto that page.  
 Regards from
 Tom :)
 
 
 --- On Sat, 29/10/11, David S. Crampton david_cramp...@ie2b.com wrote:
 
 From: David S. Crampton david_cramp...@ie2b.com
 Subject: [libreoffice-users] How may I read the value of a cell into a
 macro variable?
 To: users@global.libreoffice.org
 Date: Saturday, 29 October, 2011, 0:44
 This question has two parts: simple
 and more complex:
 
 simple: I wish to read the value of the currently selected
 cell (in Calc, of course) into a variable in the macro
 language (Libre Basic).  Script example please. and
 thank you!
 
 more complex: AFAIK the LibreHelp does not document the
 stuff like:
 
 dispatcher.executeDispatch(document, .uno:GoToCell, ,
 0, args2())
 
 I used to be pretty skilled at recording macros and then
 modifying them. Where do I go to find things related to
 uno:GoToCell?  Universal Network Objects?  Can't
 find the starting point.
 
 Thank you for an orientation,
 --David S. Crampton
 
 --For unsubscribe instructions e-mail to:
 users+h...@global.libreoffice.org
 Problems?
 http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
 Posting guidelines + more:
http://wiki.documentfoundation.org/Netiquette
 List archive: http://listarchives.libreoffice.org/global/users/
 All messages sent to this list will be publicly archived
 and cannot be deleted
 


-- 
For unsubscribe instructions e-mail to: users+h...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted