von Stephan » Do, 05.08.2004 18:59
Code: Alles auswählen
'===============================================================
' Calc-Dokument erzeugen, Werte eintragen, als *.xls speichern
' Sprache: VBScript Datum: 05.08.2004
'===============================================================
Set ser_man = WScript.CreateObject("com.sun.star.ServiceManager")
Set desk = ser_man.createInstance("com.sun.star.frame.Desktop")
Dim no_arg()
Set Doc = desk.loadComponentFromURL("private:factory/scalc", "_blank", 0, no_arg)
Set sheet = Doc.getSheets().getByIndex(0)
Call sheet.getCellByPosition(0, 0).SetFormula("Zelle A1")
Call sheet.getCellByPosition(1, 0).SetFormula("Zelle B1")
Call sheet.getCellByPosition(2, 0).SetFormula("Zelle C1")
Dim sich_arg(0)
Set sich_arg(0) = ser_man.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
sich_arg(0).Name = "FilterName"
sich_arg(0).Value = "MS Excel 97"
Doc.storeToURL "file:///d:/calc_to_excel.xls", sich_arg
Doc.close(true)
Stephan
[code]'===============================================================
' Calc-Dokument erzeugen, Werte eintragen, als *.xls speichern
' Sprache: VBScript Datum: 05.08.2004
'===============================================================
Set ser_man = WScript.CreateObject("com.sun.star.ServiceManager")
Set desk = ser_man.createInstance("com.sun.star.frame.Desktop")
Dim no_arg()
Set Doc = desk.loadComponentFromURL("private:factory/scalc", "_blank", 0, no_arg)
Set sheet = Doc.getSheets().getByIndex(0)
Call sheet.getCellByPosition(0, 0).SetFormula("Zelle A1")
Call sheet.getCellByPosition(1, 0).SetFormula("Zelle B1")
Call sheet.getCellByPosition(2, 0).SetFormula("Zelle C1")
Dim sich_arg(0)
Set sich_arg(0) = ser_man.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
sich_arg(0).Name = "FilterName"
sich_arg(0).Value = "MS Excel 97"
Doc.storeToURL "file:///d:/calc_to_excel.xls", sich_arg
Doc.close(true)[/code]
Stephan