Bonjour bernard,
peux-tu nous indiquer ce qui se trouve exactement dans la cellule à la
position 1,4 car d'après le message d'erreur, on dirait que tu ne
mentionnes pas d'extension au nom du fichier, simplement un numéro ?
ci-dessous, une fonction bâtie sur du code retrouvé sur internet et adapté.
sub enregistredoc
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
dim oDoc as object
dim oSheet as object
dim oCell  as object
dim sType as string
dim vCont as variant
' recuperation du contenu de la cellule A1
   oDoc   = ThisComponent.CurrentController
   oSheet = oDoc.ActiveSheet
   oCell = oSheet.GetCellByPosition(0,0)
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
'args1(0).Value = "file:///c:/temp/temp.ods"
'args1(0).Value = ConvertToURL("C:\temp\temp1.ods")
'msgbox(oCell.string)
args1(0).Value = ConvertToURL(oCell.string)
args1(1).Name = "FilterName"
args1(1).Value = "calc8"
dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1())
end sub
Yves
Le jeu. 13 juin 2024 à 14:47, Bernard Siaud alias Troumad <liste@siaud.org>
a écrit :
Bonjour
Je n'arrive pas à sauvegarder un fichier ouvert et modifié par macro.
Je vous montre l'ouverture, la fermeture et l'erreur générée.
Voici ma version de libo :
Version: 24.2.3.2 (X86_64)
Build ID: 420(Build:2)
CPU threads: 8; OS: Linux 6.6; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
J'essaie de sauver un fichier préalablement ouvert avec :
 vNote=StarDesktop.LoadComponentFromUrl(ConvertToUrl(page.getCellByPosition(1,4).string),
"_blank",0, args())
Voici le code qui me gène :
         args0(0).Name = "FilterName"
         args0(0).Value = "MS Excel 97"
         vNote.storeAsURL(
ConvertToURL(ConvertToURL(page.getCellByPosition(1,4).string)), args0())
Voici l'erreur qui arrive dans une boite de dialogue :
Erreur d'exécution basic.
une exception s'est produite :
Type: com.sun.star.task.ErrorCodeIOExpetion
Message: SFxBASEModel::impl_store <file:///12306900> failed: 0x507(Error
Area:Io Class:Access Code:7)
at/home/iurt/rpmbuild/BUILD/libreoffice-24.2.3.2/sfx2/source/doc/sfxmodel.cxx:3274
Le message est presque le même avec les versions 7.6 et 24 livrées par
documentfondation.
--
Amicalement vOOotre              Troumad Alias Bernard SIAUD
mon site : http://troumad.org : AD&D maths WEB...
Pour la liberté http://www.developpez.net/forums/f17/systemes/linux/
N'envoyez que des documents avec des formats ouverts, comme
http://fr.libreoffice.org
--
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous
désinscrire
Les archives de la liste sont disponibles à
https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy
-- 
web site : http://www.molenbaix.com
-- 
Envoyez un mail à users+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Context
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.