sub speichern
odoc=thiscomponent
oblatt=odoc.sheets(0)
sname=oblatt.getcellrangebyname("b1").string
spfad=oblatt.getcellrangebyname("b2").string
surl=converttourl(spfad & sname & ".ods")
dim dummy()
odoc.storeasurl(dateiurl,dummy())
end sub
ich nehme an KW ist die Kalenderwoche und steht in einer Zelle.
dann kannst du doch die Zelle im Makro abfragen.
Etwa so
odoc=thiscomponent
oblatt=odoc.sheets(0)
kw = oblatt.getCellRangeByName("B1") ' <---------- KW steht in B1
' kw0 = kw.String ' <---------- falls in B1 ein Name steht
und dann in Dateinamen schreiben. Etwa so
rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "URL"
args1(0).Value = "file:///c:/temp/Dokumente/" & "Wochenbeleg" & "_" & kw & ".ods"
args1(1).Name = "FilterName"
args1(1).Value = "calc8"