

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
13 messages in org.openoffice.fr.prog[prog] question sur copier/coller dan...| From | Sent On | Attachments |
|---|---|---|
| THEVENOUX Jean-Philippe | Jun 28, 2005 3:20 am | |
| Laurent Godard | Jun 28, 2005 3:26 am | |
| Jean...@i-carre.net | Jun 28, 2005 4:23 am | |
| THEVENOUX Jean-Philippe | Jun 28, 2005 6:15 am | |
| Laurent Godard | Jun 28, 2005 6:23 am | |
| THEVENOUX Jean-Philippe | Jun 28, 2005 6:50 am | |
| Didier Dorange-Pattoret | Jun 28, 2005 7:23 am | |
| Bernard Marcelly | Jun 29, 2005 1:37 am | |
| Bernard Marcelly | Jul 6, 2005 1:49 am | |
| Ladislas Smia | Jul 6, 2005 5:04 am | |
| Alain Nowak | Jul 7, 2005 1:09 am | |
| Sebastien Chazallet | Jul 7, 2005 10:30 am | |
| Alain Nowak | Jul 8, 2005 12:39 am |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | [prog] question sur copier/coller dans Calc | Actions... |
|---|---|---|
| From: | THEVENOUX Jean-Philippe (jp.t...@atolcd.com) | |
| Date: | Jun 28, 2005 3:20:35 am | |
| List: | org.openoffice.fr.prog | |
Bonjour a tous
J'ai un problème lors d'un copier/coller via une macro, le coller marche, mais pas le copier donc au final, la macro colle la dernière chose qui a été copier, et non pas ce que j'ai demandé. Ah oui, le copier/coller se fait dans deux fichiers !!!
Voila ma macro simplifié :
dim Feuille as object dim oRange as object dim Args(0) as new com.sun.star.beans.PropertyValue dim dispatcher as object dim oDoc as object dim args4(5) as new com.sun.star.beans.PropertyValue
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
' On sélectionne la feuille 1, et on les de A1 à I50 Feuille = ThisComponent.Sheets.getByName("Feuille1") oRange = Feuille.getCellRangeByName("A1:I50") ThisComponent.CurrentController.Select(oRange) dispatcher.executeDispatch(ThisComponent.CurrentController.Frame, ".uno:Copy", "", 0, Array())
' On ouvre le deuxième fichier Args(0).Name = "Hidden" Args(0).Value = true oDoc = StarDesktop.LoadComponentFromURL(convertToURL(CheminSource + "Essai.ods"), "_blank", 0 ,Args())
' On colle le tableau dans le deuxième fichier Feuille = oDoc.Sheets.getByName("Feuille2") oRange = Feuille.getCellRangeByName("A1") oDoc.CurrentController.Select(oRange)
' on veut coller sans garder les formules : (code créer via l'enregistreur de macro) args4(0).Name = "Flags" args4(0).Value = "SVDNT" args4(1).Name = "FormulaCommand" args4(1).Value = 0 args4(2).Name = "SkipEmptyCells" args4(2).Value = false args4(3).Name = "Transpose" args4(3).Value = false args4(4).Name = "AsLink" args4(4).Value = false args4(5).Name = "MoveMode" args4(5).Value = 4 dispatcher.executeDispatch(oDoc.CurrentController.Frame, ".uno:InsertContents", "", 0, args4())
' pour test : collage directement : dispatcher.executeDispatch(oDoc.CurrentController.Frame, ".uno:Paste", "", 0, array())
oDoc.Store oDoc.Dispose
Les deux méthode de collage donne le même résulats. Je ne comprend pas ce qu'il se passe !!! existe-t-il une autre méthode pour copier des données d'un fichier vers un autre, en gardant le formatage, mais pas les formules ???
Merci d'avance
Jean-Philippe THEVENOUX







