Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Notes r4, Lotusscript, OLE automation and Excel 7 - Automation object error

479 views
Skip to first unread message

juha mäki

unread,
Jun 27, 1996, 3:00:00 AM6/27/96
to
I've tried to use OLE automation.
Why doesn't this code work?
Analogical code in VB works fine, so I think that my registry is OK.

Sub Click(Source As Button)
Dim objWS As New notesuiworkspace
Dim obj As Variant
Set objUIdoc = objWS.currentdocument
Set obj=GetObject("c:\test.xls","Excel.sheet") 'this at least opens

Messagebox obj.name ' Here I get message: Automation object error
.
.


What I am doing wrong?

Are there BUG?

Thank you reading this :-)
I hope that you have some solution for me.

/Juha


Larry Edelstein

unread,
Jun 28, 1996, 3:00:00 AM6/28/96
to
juha...@tjgroup.fi (juha mäki) wrote:

>I've tried to use OLE automation.
>Why doesn't this code work?
>Analogical code in VB works fine, so I think that my registry is OK.

>Sub Click(Source As Button)
> Dim objWS As New notesuiworkspace
> Dim obj As Variant
> Set objUIdoc = objWS.currentdocument
> Set obj=GetObject("c:\test.xls","Excel.sheet") 'this at least opens
>
> Messagebox obj.name ' Here I get message: Automation object error

Juha, I tried this and it seemed to work fine for me.

My configuration is

Win95
Notes v4
Excel v7

I tried it on a local database; I hope that doesn't make a difference.

Larry Edelstein
Lead Programmer
SpotMedia Communications

Peter Chin

unread,
Jun 28, 1996, 3:00:00 AM6/28/96
to
juha mäki wrote:
>
> I've tried to use OLE automation.
> Why doesn't this code work?
> Analogical code in VB works fine, so I think that my registry is OK.
>
> Sub Click(Source As Button)
> Dim objWS As New notesuiworkspace
> Dim obj As Variant
> Set objUIdoc = objWS.currentdocument
> Set obj=GetObject("c:\test.xls","Excel.sheet") 'this
at least opens
>
> Messagebox obj.name ' Here I get message: Automation object error
> .
> .
>
> What I am doing wrong?
>
> Are there BUG?
>
> Thank you reading this :-)
> I hope that you have some solution for me.
>
> /JuhaThe product might be imcompatible with many VB
stuff. I tried making a 32bit api call to get
MSMAIL login UI from Lotus Script. The code works
fine in VB 4 but from Lotus it works an 10 seconds
later it GPF nlnotes.

Alex. Neihaus

unread,
Jun 29, 1996, 3:00:00 AM6/29/96
to
In article <4qu4as$c...@kuikka.inet.fi>, juha...@tjgroup.fi says...

>
>I've tried to use OLE automation.
>
>Sub Click(Source As Button)
> Dim objWS As New notesuiworkspace
> Dim obj As Variant
> Set objUIdoc = objWS.currentdocument
> Set obj=GetObject("c:\test.xls","Excel.sheet") 'this at least opens
>
> Messagebox obj.name ' Here I get message: Automation object error

I think one of your problems is that you have confused the LotusScript
GetObject **function** with the NotesUIDocument.GetObject **method**. The
former is used in LotusScript directly, the latter is provided as part of the
Notes Object Model. You can tell the difference between the two because the
LotusScript function takes two parameters, but the NotesUIDocument.GetObject
method takes only one.

I think you want to use the NotesUIDocument.GetObject method. Check the Release
4 help file for details.


--
Alex. Neihaus
Notes Marketing
Lotus Development Corp.


0 new messages