I needed to format a cell as a date in my macro, in the US format MM/DD/YY. I recorded a macro formatting it by hand in order to get some code to do it. The code is a bit cumbersome involving the use of the UNO/API. But I noticed it included the lines:
args1(0).Name = “NumberFormatValue”
args1(0).Value = 37
So as an experiment I tried doing it this way instead:
oColDCell.NumberFormat=37
where oColDCell is the name of the cell I was trying to format as a date.
And it worked.
I assume that 37 is some kind of ID for the US MM/DD/YY format. But I cannot find anywhere a list of codes/IDs corresponding to different number formats. Is there such a thing? I think it could be very useful.