Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24008 > unrolled thread

Using JAVA inside VBA

Started byGhislain <gbenrais@gmail.com>
First post2013-05-11 09:31 -0700
Last post2013-05-12 20:31 -0400
Articles 9 — 4 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Using JAVA inside VBA Ghislain <gbenrais@gmail.com> - 2013-05-11 09:31 -0700
    Re: Using JAVA inside VBA Arne Vajhøj <arne@vajhoej.dk> - 2013-05-11 12:41 -0400
      Re: Using JAVA inside VBA Ghislain <gbenrais@gmail.com> - 2013-05-11 11:45 -0700
        Re: Using JAVA inside VBA Real Gagnon <usenet@videotron.ca> - 2013-05-12 22:52 +0000
        Re: Using JAVA inside VBA Arne Vajhøj <arne@vajhoej.dk> - 2013-05-12 20:28 -0400
          Re: Using JAVA inside VBA Ghislain <gbenrais@gmail.com> - 2013-05-13 01:43 -0700
    Re: Using JAVA inside VBA "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-05-12 10:02 +0100
      Re: Using JAVA inside VBA Ghislain <gbenrais@gmail.com> - 2013-05-12 06:55 -0700
      Re: Using JAVA inside VBA Arne Vajhøj <arne@vajhoej.dk> - 2013-05-12 20:31 -0400

#24008 — Using JAVA inside VBA

FromGhislain <gbenrais@gmail.com>
Date2013-05-11 09:31 -0700
SubjectUsing JAVA inside VBA
Message-ID<825e44b1-bf36-4dfc-9d90-df4beffb7f7b@googlegroups.com>
Hello,
I have a compiled commercial jar that I want to use in VBA, something like :
Dim javaob As Object
Set javaob = CreateObject("MyJavaAPIObject")
result = javaob.doSomething()

Unforunately, I can't convert the API to a COM object. As far as I know, it was possible 10 years ago but it is no longer possible unless you use commercial products (like EZJCom).

Do you have any ideas ?
Thanks,
Ghislain

[toc] | [next] | [standalone]


#24009

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-05-11 12:41 -0400
Message-ID<518e74ad$0$32105$14726298@news.sunsite.dk>
In reply to#24008
On 5/11/2013 12:31 PM, Ghislain wrote:
> I have a compiled commercial jar that I want to use in VBA, something like :
> Dim javaob As Object
> Set javaob = CreateObject("MyJavaAPIObject")
> result = javaob.doSomething()
>
> Unforunately, I can't convert the API to a COM object. As far as I know, it was possible 10 years ago but it is no longer possible unless you use commercial products (like EZJCom).
>
> Do you have any ideas ?

12-15 years ago wrapping Java beans as COM objects was hot.

Not any more.

But try and see if something like:

http://www.rgagnon.com/javadetails/java-0045.html

still works.

Arne

[toc] | [prev] | [next] | [standalone]


#24010

FromGhislain <gbenrais@gmail.com>
Date2013-05-11 11:45 -0700
Message-ID<76b69dc2-d1cc-4095-b4a1-e44a1eabda96@googlegroups.com>
In reply to#24009
Le samedi 11 mai 2013 18:41:16 UTC+2, Arne Vajhøj a écrit :
> On 5/11/2013 12:31 PM, Ghislain wrote:
> 
> > I have a compiled commercial jar that I want to use in VBA, something like :
> 
> > Dim javaob As Object
> 
> > Set javaob = CreateObject("MyJavaAPIObject")
> 
> > result = javaob.doSomething()
> 
> >
> 
> > Unforunately, I can't convert the API to a COM object. As far as I know, it was possible 10 years ago but it is no longer possible unless you use commercial products (like EZJCom).
> 
> >
> 
> > Do you have any ideas ?
> 
> 
> 
> 12-15 years ago wrapping Java beans as COM objects was hot.
> 
> 
> 
> Not any more.
> 
> 
> 
> But try and see if something like:
> 
> 
> 
> http://www.rgagnon.com/javadetails/java-0045.html
> 
> 
> 
> still works.
> 
> 
> 
> Arne

Thanks Arne but I had tried it already and the packager used is not working anymore. I think the article was written by the time it worked (a long time ago)
Ghislain

[toc] | [prev] | [next] | [standalone]


#24018

FromReal Gagnon <usenet@videotron.ca>
Date2013-05-12 22:52 +0000
Message-ID<XnsA1BEC00914DA7rega@69.16.186.52>
In reply to#24010
Ghislain <gbenrais@gmail.com> wrote in
news:76b69dc2-d1cc-4095-b4a1-e44a1eabda96@googlegroups.com: 

> Le samedi 11 mai 2013 18:41:16 UTC+2, Arne Vajhøj a écrit :
>> But try and see if something like:
>> http://www.rgagnon.com/javadetails/java-0045.html
>> still works.
> 
> Thanks Arne but I had tried it already and the packager used is not
> working anymore. I think the article was written by the time it worked
> (a long time ago) Ghislain

ActiveX bridge is still there in 1.7.

http://docs.oracle.com/javase/7/docs/technotes/guides/beans/axbridge/develo
perguide/index.html

Bye.
-- 
Real Gagnon  from  Quebec, Canada
* Java, Javascript, VBScript or PowerBuilder snippets
* http://rgagnon.com/howto.html
* http://rgagnon.com/bigindex.html

[toc] | [prev] | [next] | [standalone]


#24019

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-05-12 20:28 -0400
Message-ID<519033b8$0$32117$14726298@news.sunsite.dk>
In reply to#24010
On 5/11/2013 2:45 PM, Ghislain wrote:
> Le samedi 11 mai 2013 18:41:16 UTC+2, Arne Vajhøj a écrit :
>> On 5/11/2013 12:31 PM, Ghislain wrote:
>>> I have a compiled commercial jar that I want to use in VBA, something like :
>>> Dim javaob As Object
>>> Set javaob = CreateObject("MyJavaAPIObject")
>>> result = javaob.doSomething()
>>>
>>> Unforunately, I can't convert the API to a COM object. As far as I know, it was possible 10 years ago but it is no longer possible unless you use commercial products (like EZJCom).
>>>
>>> Do you have any ideas ?
>>
>> 12-15 years ago wrapping Java beans as COM objects was hot.
>>
>> Not any more.
>>
>> But try and see if something like:
>>
>> http://www.rgagnon.com/javadetails/java-0045.html
>>
>> still works.
>
> I had tried it already and the packager used is not working anymore. I think the article was written by the time it worked (a long time ago)

Could you elaborate on "not working"?

COM has not changed.

Java version X has not changed.

Why did it work once and no longer?

Arne

[toc] | [prev] | [next] | [standalone]


#24031

FromGhislain <gbenrais@gmail.com>
Date2013-05-13 01:43 -0700
Message-ID<0665534f-c70b-49e0-bdca-15dcf5908f03@googlegroups.com>
In reply to#24019
Le lundi 13 mai 2013 02:28:39 UTC+2, Arne Vajhøj a écrit :
> On 5/11/2013 2:45 PM, Ghislain wrote:
> 
> > Le samedi 11 mai 2013 18:41:16 UTC+2, Arne Vajhøj a écrit :
> 
> >> On 5/11/2013 12:31 PM, Ghislain wrote:
> 
> >>> I have a compiled commercial jar that I want to use in VBA, something like :
> 
> >>> Dim javaob As Object
> 
> >>> Set javaob = CreateObject("MyJavaAPIObject")
> 
> >>> result = javaob.doSomething()
> 
> >>>
> 
> >>> Unforunately, I can't convert the API to a COM object. As far as I know, it was possible 10 years ago but it is no longer possible unless you use commercial products (like EZJCom).
> 
> >>>
> 
> >>> Do you have any ideas ?
> 
> >>
> 
> >> 12-15 years ago wrapping Java beans as COM objects was hot.
> 
> >>
> 
> >> Not any more.
> 
> >>
> 
> >> But try and see if something like:
> 
> >>
> 
> >> http://www.rgagnon.com/javadetails/java-0045.html
> 
> >>
> 
> >> still works.
> 
> >
> 
> > I had tried it already and the packager used is not working anymore. I think the article was written by the time it worked (a long time ago)
> 
> 
> 
> Could you elaborate on "not working"?
> 
> 
> 
> COM has not changed.
> 
> 
> 
> Java version X has not changed.
> 
> 
> 
> Why did it work once and no longer?
> 
> 
> 
> Arne

Hello Arne,
"not working" means that after this command :
"C:\Program Files (x86)\Java\jdk1.7.0_21\bin\packager" -clsid {c6d7e762-5c47-4385-882d-b4679a013bdf} -out "C:\Program Files (x86)\Java\jre7\axbridge\bin" "C:\Users\gbenrais\Documents\NetBeansProjects\PersonBean\dist\PersonBean.jar" org.netbeans.examples.person.PersonBean

I get the following result :
Processing C:\Users\gbenrais\AppData\Local\Temp\\PersonBean.idl
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\oaidl.idl
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\objidl.idl
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\unknwn.idl
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\wtypes.idl
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\basetsd.h
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\guiddef.h
Processing C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\oaidl.acf
midl\oleaut32.dll : error MIDL2020 : error generating type library : SetFuncAndParamNames failed : get_address (0x8002802C)
La génération de la bibliothèque type a échoué          


I tried with different java apis and it failed at the very same step with the same error

Thanks for your help,
Ghislain

[toc] | [prev] | [next] | [standalone]


#24012

From"Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Date2013-05-12 10:02 +0100
Message-ID<XLGdnRwvt7kexhLMnZ2dnUVZ7oidnZ2d@bt.com>
In reply to#24008
Ghislain wrote:
> Hello,
> I have a compiled commercial jar that I want to use in VBA, something

> Unforunately, I can't convert the API to a COM object. As far as I know,
> it was possible 10 years ago but it is no longer possible unless you use
> commercial products (like EZJCom).
>
> Do you have any ideas ?

Buy the commercial product ?

Wrap the JAR up in an executable that makes the API available over TCP/IP, and 
then create a COM object that uses that network interface ?

If you are capable of developing simple COM objects in C++, then it might be 
simpler to use something like Jace:
    http://code.google.com/p/jace/wiki/Overview
to create JNI-based wrapper code that your COM-server layer can talk to.

Open Office / Libre Office used to be able to talk to Java, as I understand it. 
Maybe they still can, and it would be easier for you to use your existing 
commercial component with one of them.

If you have the remarkably good sense, not to mention good fortune, to be a 
Smalltalk programmer, then you could use Dolphin Smalltalk (which can generate 
COM objects) + my very own (advt.) JNIPort to bridge between COM and Java...

But buying the commercial product seems the best bet to me.  After all, you've 
already paid for the two products you want to connect, why baulk at paying for 
the bridge too ?

    -- chris 

[toc] | [prev] | [next] | [standalone]


#24014

FromGhislain <gbenrais@gmail.com>
Date2013-05-12 06:55 -0700
Message-ID<18974868-a160-4ac1-a2e2-dbfcf494eb3d@googlegroups.com>
In reply to#24012
Le dimanche 12 mai 2013 11:02:02 UTC+2, Chris Uppal a écrit :
> Ghislain wrote:
> 
> > Hello,
> 
> > I have a compiled commercial jar that I want to use in VBA, something
> 
> 
> 
> > Unforunately, I can't convert the API to a COM object. As far as I know,
> 
> > it was possible 10 years ago but it is no longer possible unless you use
> 
> > commercial products (like EZJCom).
> 
> >
> 
> > Do you have any ideas ?
> 
> 
> 
> Buy the commercial product ?
> 
> 
> 
> Wrap the JAR up in an executable that makes the API available over TCP/IP, and 
> 
> then create a COM object that uses that network interface ?
> 
> 
> 
> If you are capable of developing simple COM objects in C++, then it might be 
> 
> simpler to use something like Jace:
> 
>     http://code.google.com/p/jace/wiki/Overview
> 
> to create JNI-based wrapper code that your COM-server layer can talk to.
> 
> 
> 
> Open Office / Libre Office used to be able to talk to Java, as I understand it. 
> 
> Maybe they still can, and it would be easier for you to use your existing 
> 
> commercial component with one of them.
> 
> 
> 
> If you have the remarkably good sense, not to mention good fortune, to be a 
> 
> Smalltalk programmer, then you could use Dolphin Smalltalk (which can generate 
> 
> COM objects) + my very own (advt.) JNIPort to bridge between COM and Java...
> 
> 
> 
> But buying the commercial product seems the best bet to me.  After all, you've 
> 
> already paid for the two products you want to connect, why baulk at paying for 
> 
> the bridge too ?
> 
> 
> 
>     -- chris

Thank you Chris for these interestings ideas. 
I already bought the awfully expensive software but it is only available in java.
I'll try jace but I understand it is not as simple as it used to be with the sun's packager.
Ghislain

[toc] | [prev] | [next] | [standalone]


#24020

FromArne Vajhøj <arne@vajhoej.dk>
Date2013-05-12 20:31 -0400
Message-ID<5190347d$0$32118$14726298@news.sunsite.dk>
In reply to#24012
On 5/12/2013 5:02 AM, Chris Uppal wrote:
> Ghislain wrote:
>> I have a compiled commercial jar that I want to use in VBA, something
>
>> Unforunately, I can't convert the API to a COM object. As far as I know,
>> it was possible 10 years ago but it is no longer possible unless you use
>> commercial products (like EZJCom).
>>
>> Do you have any ideas ?
>
> Buy the commercial product ?
>
> Wrap the JAR up in an executable that makes the API available over TCP/IP, and
> then create a COM object that uses that network interface ?
>
> If you are capable of developing simple COM objects in C++, then it might be
> simpler to use something like Jace:
>      http://code.google.com/p/jace/wiki/Overview
> to create JNI-based wrapper code that your COM-server layer can talk to.
>
> Open Office / Libre Office used to be able to talk to Java, as I understand it.
> Maybe they still can, and it would be easier for you to use your existing
> commercial component with one of them.

OOo/LO use UNO and there is an UNO binding for Java.

And it would very difficult to remove as certain parts of OOo/LO are
written in Java.

> If you have the remarkably good sense, not to mention good fortune, to be a
> Smalltalk programmer, then you could use Dolphin Smalltalk (which can generate
> COM objects) + my very own (advt.) JNIPort to bridge between COM and Java...
>
> But buying the commercial product seems the best bet to me.  After all, you've
> already paid for the two products you want to connect, why baulk at paying for
> the bridge too ?

You get lots of money by not spending them.

:-)

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web