com.sun.lang.servicenotregisteredexception

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
rpiccardi
Posts: 2
Joined: Thu Dec 20, 2007 3:06 pm

com.sun.lang.servicenotregisteredexception

Post 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
B Marcelly
Volunteer
Posts: 1160
Joined: Mon Oct 08, 2007 1:26 am
Location: France, Paris area

Re: com.sun.lang.servicenotregisteredexception

Post 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.
rpiccardi
Posts: 2
Joined: Thu Dec 20, 2007 3:06 pm

Re: com.sun.lang.servicenotregisteredexception

Post by rpiccardi »

:roll: thanks...... I'm sorry .
:oops:
Post Reply