von Simon23 » Sa, 18.08.2007 12:58
Ich habe den Fehler gefunden, ich x natürlich wieder auf 0 zurücksetzen:
Code: Alles auswählen
[...]
while y < 10
while x < 10
oDoc2.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)=oDoc1.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)
x = x + 1
wend
x = 0
y = y + 1
wend
Jetzt klappt es auch, ist halt nur nicht sonderlich elegant...
Es bleibt allerdings noch das Problem der PDF Ausgabe.
Ich habe unter
http://www.starbasicfaq.de/Wiekannmanmi ... l#Zweig134 schon nachgelesen, wie es gehen müsste, es klappt aber noch nicht.
Code: Alles auswählen
Sub Main
Dim sUrl1 as string
Dim sUrl2 as string
Dim Temp as string
Dim myProps(0) as New com.sun.star.beans.PropertyValue
Dim x as Integer
Dim y as Integer
sUrl1 = convertToURL("C:\TestB.ods")
sUrl2 = convertToURL("C:\TestC.ods")
oDoc1 = StarDesktop.loadComponentFromURL(sUrl1, "_blank", 0, myProps())
oDoc2 = StarDesktop.loadComponentFromURL(sUrl2, "_blank", 0, myProps())
x = 0
y = 0
while y < 10
while x < 10
oDoc2.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)=oDoc1.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)
x = x + 1
wend
x = 0
y = y + 1
wend
' Jetzt als PDF speichern
DIM sUrl as string
Dim myProps2(0) as New com.sun.star.beans.PropertyValue
sUrl = convertToURL("C:\Test.pdf")
myProps2(0).Name="FilterName"
myProps2(0).Value = "writer_pdf_Export"
oDoc2.storetoUrl(sUrl,myProps2())
End Sub
Für eine kleine Hilfe wäre ich sehr dankbar.
Simon
Ich habe den Fehler gefunden, ich x natürlich wieder auf 0 zurücksetzen:
[code]
[...]
while y < 10
while x < 10
oDoc2.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)=oDoc1.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)
x = x + 1
wend
x = 0
y = y + 1
wend
[/code]
Jetzt klappt es auch, ist halt nur nicht sonderlich elegant...
Es bleibt allerdings noch das Problem der PDF Ausgabe.
Ich habe unter [url]http://www.starbasicfaq.de/WiekannmanmitStarbasiceinDokumentalsPDFs.html#Zweig134[/url] schon nachgelesen, wie es gehen müsste, es klappt aber noch nicht.
[code]
Sub Main
Dim sUrl1 as string
Dim sUrl2 as string
Dim Temp as string
Dim myProps(0) as New com.sun.star.beans.PropertyValue
Dim x as Integer
Dim y as Integer
sUrl1 = convertToURL("C:\TestB.ods")
sUrl2 = convertToURL("C:\TestC.ods")
oDoc1 = StarDesktop.loadComponentFromURL(sUrl1, "_blank", 0, myProps())
oDoc2 = StarDesktop.loadComponentFromURL(sUrl2, "_blank", 0, myProps())
x = 0
y = 0
while y < 10
while x < 10
oDoc2.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)=oDoc1.sheets(0).getCellByPosition(x,y).Cellbackcolor(R,G,B)
x = x + 1
wend
x = 0
y = y + 1
wend
' Jetzt als PDF speichern
DIM sUrl as string
Dim myProps2(0) as New com.sun.star.beans.PropertyValue
sUrl = convertToURL("C:\Test.pdf")
myProps2(0).Name="FilterName"
myProps2(0).Value = "writer_pdf_Export"
oDoc2.storetoUrl(sUrl,myProps2())
End Sub
[/code]
Für eine kleine Hilfe wäre ich sehr dankbar.
Simon