How to embed image with macro?
I have this function
Code: Select all
Function FuncInsertImage(sPath As String, iWidth As Integer, iHeight As Integer, oBook As Object)
Dim oSheet As Object
Dim oImage As Object
Dim sUrl As String
Dim oTam As New com.sun.star.awt.Size
sUrl = ConvertToURL(sPath)
oSheet = oBook.getCurrentController.getActiveSheet.getDrawPage()
oImage = oLibro.createInstance("com.sun.star.drawing.GraphicObjectShape")
oImagen.GraphicURL = sUrl
oSheet.add(oImage)
oTam.Width = iWidth
oTam.Height = iHeight
oImage.setSize(oTam)
End Function
I need to embed it in the sheet