Hello ,
i'm writing a macro in OOBasic to insert, size and position a graphic in a calc document but ..
error message :........ com.sun.lang.servicenotregisteredexception
.................
dim mnoargs()
dim sgraphicurl as string
dim sgraphicservice as string, surl as string
dim odrawpages as object, odrawpage as object
dim ographic as object
sgraphicservice="com.sun.star.drawing.graphicobjectshape"
odrawpage=osheet.getdrawpage()
---> ographic=thiscomponent.createinstance(sgraphicservice) <------
ographic.graphicurl= sgraphicurl
odrawpage.add(ographic)
..............
thanks
com.sun.lang.servicenotregisteredexception
-
- Volunteer
- Posts: 1160
- Joined: Mon Oct 08, 2007 1:26 am
- Location: France, Paris area
Re: com.sun.lang.servicenotregisteredexception
You know, there are 2 keys on either side of your keyboard : the Shift keysrpiccardi wrote:error message :........ com.sun.lang.servicenotregisteredexception
.................
sgraphicservice="com.sun.star.drawing.graphicobjectshape"

Service names are case sensitive. Try this:
com.sun.star.drawing.GraphicObjectShape
And this is more readable : ServiceNotRegisteredException
And code is more readable if enclosed on Code tags. There is a button for this in the edit page.
Re: com.sun.lang.servicenotregisteredexception

