Change in use of basic (uno) api since version 5.1?

classic Classic list List threaded Threaded
9 messages Options
Winfried Donkers Winfried Donkers
Reply | Threaded
Open this post in threaded view
|

Change in use of basic (uno) api since version 5.1?

Hi all,

I use basic scripts in our ERP system to open, create, modify, etc. Calc documents.
This worked fine with LibreOffice for years till version 5.1.

The LO-part of the scripts start with the line

  Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )

With LO version 5.1 this line produces an error (Err.Number is -2147418113, F8000FFFF).
There are no changes in the ERP system nor in the scripts, everything still works fine on machines with LO 5.0. Only the machines with LO 5.1 have this problem.

I couldn't find anything related in the release notes for version 5.1.
What has changed and what can I do to get the scripts working again with LibreOffice?


Winfried

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Piet van Oostrum-2 Piet van Oostrum-2
Reply | Threaded
Open this post in threaded view
|

Re: Change in use of basic (uno) api since version 5.1?

Winfried Donkers wrote:

 > Hi all,
 >
 > I use basic scripts in our ERP system to open, create, modify, etc. Calc documents.
 > This worked fine with LibreOffice for years till version 5.1.
 >
 > The LO-part of the scripts start with the line
 >
 >   Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
 >
 > With LO version 5.1 this line produces an error (Err.Number is -2147418113, F8000FFFF).
 > There are no changes in the ERP system nor in the scripts, everything still works fine on machines with LO 5.0. Only the machines with LO 5.1 have this problem.
 >
 > I couldn't find anything related in the release notes for version 5.1.
 > What has changed and what can I do to get the scripts working again with LibreOffice?
 >
According to Andrew Pitonyak's documentation, the way to get the service manager is
oServiceMgr = GetProcessServiceManager()

Maybe you could try that.
--
Piet van Oostrum <[hidden email]>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Winfried Donkers Winfried Donkers
Reply | Threaded
Open this post in threaded view
|

RE: Change in use of basic (uno) api since version 5.1?

Hi Piet,

>  >
>  > The LO-part of the scripts start with the line  >
>  >   Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
>  >
> According to Andrew Pitonyak's documentation, the way to get the service
> manager is oServiceMgr = GetProcessServiceManager()
>
> Maybe you could try that.

I tried, no luck, GetProcessServiceManager() is not recognised.

AFAIK GetProcessServiceManager() is used within an LO-application and not from outside.
There is no function GetProcessServiceManager() in VBasic (and there may not be an active ServiceManager either).

Winfried
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Winfried Donkers Winfried Donkers
Reply | Threaded
Open this post in threaded view
|

RE: Change in use of basic (uno) api since version 5.1?

Hi Piet,

> >  >
> >  > The LO-part of the scripts start with the line  >
> >  >   Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
> >  >
> > According to Andrew Pitonyak's documentation, the way to get the
> > service manager is oServiceMgr = GetProcessServiceManager()
> >
> > Maybe you could try that.
>
> I tried, no luck, GetProcessServiceManager() is not recognised.
>
> AFAIK GetProcessServiceManager() is used within an LO-application and not
> from outside.
> There is no function GetProcessServiceManager() in VBasic (and there may
> not be an active ServiceManager either).
>

FYI, listing 454 of Andrew's 'OpenOffice Macros Explained' uses CreateObject when the macro is run from Excel.

Winfried
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
SOS SOS
Reply | Threaded
Open this post in threaded view
|

Re: Change in use of basic (uno) api since version 5.1?

In reply to this post by Winfried Donkers
Halo Winfried
works as normal  for me on (windows) LO 5.1.2.2
greetz
Fernand
On 31/05/2016 9:17, Winfried Donkers wrote:

> Hi all,
>
> I use basic scripts in our ERP system to open, create, modify, etc. Calc documents.
> This worked fine with LibreOffice for years till version 5.1.
>
> The LO-part of the scripts start with the line
>
>    Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
>
> With LO version 5.1 this line produces an error (Err.Number is -2147418113, F8000FFFF).
> There are no changes in the ERP system nor in the scripts, everything still works fine on machines with LO 5.0. Only the machines with LO 5.1 have this problem.
>
> I couldn't find anything related in the release notes for version 5.1.
> What has changed and what can I do to get the scripts working again with LibreOffice?
>
>
> Winfried
>
> _______________________________________________
> LibreOffice mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/libreoffice

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Winfried Donkers Winfried Donkers
Reply | Threaded
Open this post in threaded view
|

RE: Change in use of basic (uno) api since version 5.1?

Hi Fernand,

> works as normal  for me on (windows) LO 5.1.2.2 greetz Fernand On


> > The LO-part of the scripts start with the line
> >
> >    Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
> >

Do you  mean that the following vbscript:

 option explicit

 Dim t

 set t = WScript.CreateObject( "com.sun.star.ServiceManager")
 msgbox "srv-mgr created"
 set t = nothing

 set t = CreateObject( "com.sun.star.ServiceManager")
 msgbox "srv-mgr created again"
 set t = nothing

runs without error on your machine with windows and LO5.1.2.2?

Here, I use LO 5.1.3.2 and Windows7-64; neither of the 2 CreateObject calls succeed.

Winfried

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
SOS SOS
Reply | Threaded
Open this post in threaded view
|

Re: Change in use of basic (uno) api since version 5.1?

Winfried,

On 31/05/2016 11:46, Winfried Donkers wrote:

> Hi Fernand,
>
>> works as normal  for me on (windows) LO 5.1.2.2 greetz Fernand On
>
>>> The LO-part of the scripts start with the line
>>>
>>>     Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
>>>
> Do you  mean that the following vbscript:
>
>   option explicit
>
>   Dim t
>
>   set t = WScript.CreateObject( "com.sun.star.ServiceManager")
>   msgbox "srv-mgr created"
>   set t = nothing
>
>   set t = CreateObject( "com.sun.star.ServiceManager")
>   msgbox "srv-mgr created again"
>   set t = nothing
>
> runs without error on your machine with windows and LO5.1.2.2?
>
> Here, I use LO 5.1.3.2 and Windows7-64; neither of the 2 CreateObject calls succeed.
>
> Winfried
Nono Sorry
I just run under LO basic  the folowing sub where Xray returns the
ServiceManager

sub test
Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
xray oServiceManager
end sub
>

_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Winfried Donkers Winfried Donkers
Reply | Threaded
Open this post in threaded view
|

RE: Change in use of basic (uno) api since version 5.1?

Hi Fernand,

> > Do you  mean that the following vbscript:
> >
> >   option explicit
> >
> >   Dim t
> >
> >   set t = WScript.CreateObject( "com.sun.star.ServiceManager")
> >   msgbox "srv-mgr created"
> >   set t = nothing
> >
> >   set t = CreateObject( "com.sun.star.ServiceManager")
> >   msgbox "srv-mgr created again"
> >   set t = nothing
> >
> > runs without error on your machine with windows and LO5.1.2.2?
> >

> Nono Sorry
> I just run under LO basic  the folowing sub where Xray returns the
> ServiceManager
>

Yep, I thought so. My problem occurs when the macro/script has to run outside of LO (i.e. from Windows script, Excel macro or ERP script).

Winfried
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Winfried Donkers Winfried Donkers
Reply | Threaded
Open this post in threaded view
|

RE: Change in use of basic (uno) api since version 5.1?

In reply to this post by Winfried Donkers
I just was pointed to tdf#99643, which reports my problem.

Winfried


>
> I use basic scripts in our ERP system to open, create, modify, etc. Calc
> documents.
> This worked fine with LibreOffice for years till version 5.1.
>
> The LO-part of the scripts start with the line
>
>   Set oServiceManager = CreateObject( "com.sun.star.ServiceManager" )
>
> With LO version 5.1 this line produces an error (Err.Number is -
> 2147418113, F8000FFFF).
> There are no changes in the ERP system nor in the scripts, everything
> still works fine on machines with LO 5.0. Only the machines with LO 5.1
> have this problem.
>
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice