die Aufgabe ist sicherlich nicht besonders schwierig zu erledigen:
Ich möchte ein Makro schreiben, dass in Calc die "Cellbackcolor" der Zellen von Dokument "TestA" zu Dokument "TestB" kopiert. Danach soll das Dokument "TestB" als PDF ausgegeben werden.
Ich möchte gar keine Lösung sondern nur eine kleine Hilfe...
Folgendes habe ich mir bislang überlegt:
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
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
y = y + 1
wend
End Sub
Vielen Dank
Simon