Bonjour à tous
Petit soucis avec calc:
Comment peut on indiquer
une date de création (autrement qu'en la tapant bien sur) et que celle
ci reste statique
La commande (AUJOURDHUI) la met mais change chaque
jour
Sur Excel, la commande "Ctrl + ;" la mettait et ne changeait pas à chaque ouverture (V4 et V Office97). Après je ne sais plus

Existe-t-il une commande analogue sur Calc
Merci de vos lumières
Claude


Et pour ceux qui voudraient avoir une date fixe insérée à l'ouverture, une macro fait ça très bien, avec ce code :

Sub insertDate
  Dim aLocale as new com.sun.star.lang.Locale, vNumFormat
  Dim oDoc as Object : oDoc = ThisComponent
  Dim oCell as Object : oCell = oDoc.CurrentSelection
  Dim sFormat as String : sFormat = "JJJJ JJ MMMM AAAA"
  If oCell.supportsService( "com.sun.star.sheet.SheetCell" ) Then
     oCell.setValue( Now() )
vNumFormat = oDoc.getNumberFormats().queryKey( sFormat, aLocale, TRUE )
     If ( vNumFormat = -1 ) Then
        vNumFormat = oDoc.getNumberFormats().addNew( sFormat, aLocale )
     End If
     oCell.NumberFormat = vNumFormat
  End If
End Sub

voici l'exemple du fichier Calc (fichier attaché)

J.M

Attachment: Insertion de la date lors ouverture fichier.ods
Description: application/vnd.oasis.opendocument.spreadsheet

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@fr.openoffice.org
For additional commands, e-mail: users-h...@fr.openoffice.org

Répondre à