Does this macro work for non en-US locale?

My Macro book contains the following macro, which works just fine for me:

Sub ExampleDatePart
   Dim TheDate As Date
   Dim f
   Dim i As Integer
   Dim s$
   TheDate = Now
   f = Array("yyyy", "q", "m", "y", "w", "ww", "d", "h", "n", "s")
    s = "Now = " & TheDate & CHR$(10)
   For i = LBound(f) To UBound(f)
     s = s & "DatePart(" & f(i) & ", " & TheDate & ") = " & _
              DatePart(f(i), TheDate) & CHR$(10)
   Next
   MsgBox s
End Sub

My German translator claims that he requires CompatibilityMode(True), or this fails to run. Any comments are appreciated.

Note: English and German translations are a work in progress and are available as a free download.

hi andrew,

i like and use your book OOME. thanks.

your macro should normally work in any locale.

but, if you'd use a literal date instead of now it would be interpreted
differently under different locales: d/m/y, m/d/y, y-m-d etc.
TheDate = "2011-12-31 04:36:15" worked perfectly for me in hebrew and english
locales, with different default date formats.

best regards,
alex

Sub ExampleDatePart
   Dim TheDate As Date
   Dim f
   Dim i As Integer
   Dim s$
   TheDate = Now
   f = Array("yyyy", "q", "m", "y", "w", "ww", "d", "h", "n", "s")
    s = "Now = "& TheDate& CHR$(10)
   For i = LBound(f) To UBound(f)
     s = s& "DatePart("& f(i)& ", "& TheDate& ") = "& _
              DatePart(f(i), TheDate)& CHR$(10)
   Next
   MsgBox s
End Sub

hi andrew,

i like and use your book OOME. thanks.

Your welcome

your macro should normally work in any locale.

but, if you'd use a literal date instead of now it would be interpreted
differently under different locales: d/m/y, m/d/y, y-m-d etc.
TheDate = "2011-12-31 04:36:15" worked perfectly for me in hebrew and english
locales, with different default date formats.

best regards,
alex

Excellent, thanks for checking.

Hi,

I am using LibreOffice 3.4.2 on WinXP and I have discovered a strange
thing : the settings in Tools -> Options -> Impress - Print dialog.

Step1
  Create new Impress file and save as "FileNameA.odp".

Step2
  change the setting in Tools -> Options -> Impress - Print - Page
Options:
   select "Fit to page" (from Default)
   and then Click "OK"

Step3
  Edit slide something
  and the "Save"

Step4
  Creat new one more Impress file

Step5
  Confirm the setting in Tools -> Options -> Impress - Print - Page
Options:
   stay in "Fit to page"

Step6
  save as "FileNameB.odp"

Step7
  Close both of "FileNameA.odp" and "FileNameB.odp"

Step8
  Create new Impress file

Step9
  Confirm the setting in Tools -> Options -> Impress - Print - Page
Options:
   stay in "Fit to page"

Step10
  Open "FileNameA.odp"

Step11
  Confirm the setting in Tools -> Options -> Impress - Print - Page
Options:
  !? Default !?

Why I get Page Options:Default ??

Do I have missed something?
Is there anyone else experiencing this?
Is there a solution?
Is it a well known problem?

Best Regards,

I'm sorry that I made mistake.
I put this question in another thread.

I will post new one.

Thaks

(2011/08/03 16:34), Hirono Moi wrote:

Hi Hirono,

I use LO on Ubuntu 10.04.

I also get the described behaviour but only when I have not restarted LO.

The first time I opened LO and reproduced your steps it worked exactly
as you stated.

I closed LO and opened it again and the 'default' was then "Fit to Page"

I take it from my test that the configuration file is not updated in
this instance until LO is restarted.

Try changing the value of Tools -> Options -> Impress - Print - Page
to "Fit to Page" then restart LO. What is the value when you restart LO
"Default" or "Fit to Page"?

Hi Simon,

Thank you very much your reproducing and advice.

I take it from my test that the configuration file is not updated in
this instance until LO is restarted.

Yes, I know you're right, but,
After I restarted LO,
and then I opend "FileNameA.odp" or "FileNameB.odp",
the value was 'default'.

How about in your case?

Regards,

(2011/08/05 11:10), Simon Cropper (The foss Workflow Guides) wrote:

Hi Hirono,

You are right, on reopening saved versions it seems to reset the value
back to default. At least now it does.

If I open LO then change, save and reenter Impress Print Setting in LO
the setting is retained.

If I open LO save a file after previously setting the Impress Print
Setting, the value return to default.

If I reset the value and exit the reenter LO and
  -- open new file, the adjusted setting is retained
  -- open an existing file, the adjusted setting is retained

If I save the file
  -- setting is retained while changed file is open
  -- setting is now reset to default on reopening the file and
     continues to reset the value despite me changing the value.

If I create a new file and start again the value update is sticky until
I reopen a saved document.

*My take on what is happening*

The 'Page options' is being saved to file (or at least attempted to be
saved to file. When you open an existing document it overwrites the
saved data into the configuration file for Impress.

The problem appears to be that the value selected for 'Page options' is
not being set, despite being updated when an existing file is reopened,
or is being stored incorrectly.

You will need to post a bug on the system and get one of the developers
to change this behaviour, to me it does appear to be a BUG.

Hi Simon,

Thank you very much your repeated tests and advice.

I entirely agree with your view.

I would like to know a workaround ofsome kind, if you have any idea.

Regards,

(2011/08/05 15:11), Simon Cropper (The foss Workflow Guides) wrote:

Hello,
I tried to define a combo box in Scalc which take its source cell range from a table. When I enter the cell reference directly, it works as expected. I defined a name for the table, but when I try to used it instead of the direct cell reference, I just get a blank combo box. I tried several syntax like 'name', ='name' but that doen't make any difference. I tried that both under version 3.3.3 (on Windows XP Pro 32 bit) and version 3.4.2 (on Windows 7 64 bit). That doesn't make any difference either.
Is there a way to make that works?
(In fact the original file was made with MS Excel XP)
Thanks in advance,
Jean-Louis

Simon,

Thank you very much for your advices.

Yes, I posted a bug report with more result of my tests:
https://bugs.freedesktop.org/show_bug.cgi?id=39854

It seems that the behavor chages depending on the presence or absence
of soffice.bin.

Thank you, again.

(2011/08/06 0:17), Simon Cropper wrote: