Page 1 of 1

com.sun.lang.servicenotregisteredexception

Posted: Thu Dec 20, 2007 3:37 pm
by rpiccardi
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

Re: com.sun.lang.servicenotregisteredexception

Posted: Thu Dec 20, 2007 6:04 pm
by B Marcelly
rpiccardi wrote:error message :........ com.sun.lang.servicenotregisteredexception
.................
sgraphicservice="com.sun.star.drawing.graphicobjectshape"
You know, there are 2 keys on either side of your keyboard : the Shift keys :mrgreen:

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

Posted: Fri Dec 21, 2007 2:29 pm
by rpiccardi
:roll: thanks...... I'm sorry .
:oops: