[Solved] Accessing DCOM objects

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Slowmo
Posts: 3
Joined: Fri Aug 28, 2015 6:38 pm

[Solved] Accessing DCOM objects

Post by Slowmo »

Is it possible to access DCOM from OOo BASIC? In MS VBA I could add a reference to any registered DCOM object and use it's classes. I understand this approach would not be very portable, but anyway, am I out of luck here?
Last edited by Slowmo on Mon Aug 31, 2015 9:14 am, edited 1 time in total.
OpenOffice 4.1.1 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Accessing DCOM objects

Post by Villeroy »

Yes, completely out of luck. But there is much more than StarBasic. You have at least 4 macro languages.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Slowmo
Posts: 3
Joined: Fri Aug 28, 2015 6:38 pm

Re: Accessing DCOM objects

Post by Slowmo »

I have an MS Excel workbook with forms and lots of VBA. Wanted to port it to Calc, but mentioned DCOM usage prevents me from doing that. Can other macro languages interact with forms (open them, handle button presses e.t.c)? Which of those languages allow to work with DCOM?
OpenOffice 4.1.1 on Windows 10
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Accessing DCOM objects

Post by FJCC »

Python is one of the macro languages. Knowing nothing at all about DCOM, I did a web search on python DCOM and got some hits, though they are not recent.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
karolus
Volunteer
Posts: 1158
Joined: Sat Jul 02, 2011 9:47 am

Re: Accessing DCOM objects

Post by karolus »

Hallo

This one looks promising --

Karolus
AOO4, Libreoffice 6.1 on Rasbian OS (on ARM)
Libreoffice 7.4 on Debian 12 (Bookworm) (on RaspberryPI4)
Libreoffice 7.6 flatpak on Debian 12 (Bookworm) (on RaspberryPI4)
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Accessing DCOM objects

Post by Villeroy »

And this one: Delphi: Dual unit to use Excel or OOo Calc transparently although I'm not 100% sure if that one relies on DCOM but I think so.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Slowmo
Posts: 3
Joined: Fri Aug 28, 2015 6:38 pm

Re: Accessing DCOM objects

Post by Slowmo »

I think I found an answer myself and initial tests appear to be successful.

As a reference I used this example which accesses Internet Explorer COM object.

Code: Select all

dim dispatcher as object
dim oExplorer as object
dispatcher = createUnoService("com.sun.star.bridge.OleObjectFactory")
oExplorer = dispatcher.createInstance("InternetExplorer.Application")
If Not IsNull(oExplorer) Then
	oExplorer.visible = true
	oExplorer.Navigate2("http://www.openoffice.org")
Else
	MsgBox("Could not perform test with Internet Explorer!")	
End If
OpenOffice 4.1.1 on Windows 10
Post Reply