Ver Mensaje Individual
  #4 (permalink)  
Antiguo 15/02/2006, 02:53
Avatar de Haize25
Haize25
 
Fecha de Ingreso: febrero-2006
Mensajes: 4
Antigüedad: 19 años, 2 meses
Puntos: 0
Usando loadComponentFromURL(url)

Supongo que este código te ayudará... al menos es un comienzo.
Un saludo



Private Sub B_CrearCalc_Click()
Dim args()
Dim objServiceManager As Object
Dim objDesktop As Object
Dim objDocument As Object
Dim objHoja As Object

Set objServiceManager = CreateObject("com.sun.star.ServiceManager")
Set objDesktop = objServiceManager.createInstance("com.sun.star.fra me.Desktop")
Set objDocument = objDesktop.loadComponentFromURL("private:factory/scalc", "_blank", 0, args)

Set objHoja = objDocument.getSheets().getByIndex(0)
Call objHoja.getCellByPosition(0, 0).SetFormula("Meses")
Call objHoja.getCellByPosition(1, 0).SetFormula("Ventas")
Call objHoja.getCellByPosition(0, 1).SetFormula("Enero")
Call objHoja.getCellByPosition(0, 2).SetFormula("Febrero")
Call objHoja.getCellByPosition(0, 3).SetFormula("Marzo")
Call objHoja.getCellByPosition(1, 1).SetValue(3827)
Call objHoja.getCellByPosition(1, 2).SetValue(3978)
Call objHoja.getCellByPosition(1, 3).SetValue(4103)

Set objServiceManager = Nothing
Set objDesktop = Nothing
Set objDocument = Nothing
Set objHoja = Nothing
End Sub