Automation object error when going from lotus notes to excel 97

Hello this is a part of my code.
I am in Lotus Notes and in LS i'am trying to create and manipulate all sort of things in an excel file.
The lotus notes program works on the server but the clients my have office2000 (excel.9)  or office97 (excel.8). The code works perfect for office 2000 but gives the error message " automation object error " in the line Excel.visible for an office 97. What i think is strange is that the errormessage comes after the Errorhandling part ( If Err Or( Excel Is Nothing) Then )
Is there a simple workaround?????

the code :

Dim Excel As Variant
Dim xlsheet As Variant
filename = "C:\Addressbook_"+"name"+".xls"
Set Excel = CreateObject("Excel.application")
If Err Or( Excel Is Nothing) Then
    Messagebox("oopssss  wrong excel version")
    Exit Sub
End If
 >>>>> get stuck here >>>>>    Excel.Visible = No
  Excel.Workbooks.add
  Set xlsheet = Excel.Workbooks(1).Worksheets(1)
  xlsheet.Activate
 xlsheet.Name = "Contacts"
     

ruddiAsked:
Who is Participating?
 
bruintjeConnect With a Mentor Commented:
and when you change them just to test it out to US? there where problems with Finish settings so that's why i said it may be far off
0
 
rkot2000Commented:
maybe Excel.Visible = false
0
 
gencrossCommented:
Is this code running from Lotus Notes?

The syntax does not look correct for VB.

Have you tried...

Excel.Visible = False

Also, Why are you Dimming Excel and xlsheet as Variant?

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ruddiAuthor Commented:
Yes it is running in Lotus Script. The code works on a machine with office 2000 and fails on a client who has office 97. So there is nothing wrong with the code syntax
0
 
bruintjeCommented:
you say >> in the line Excel.visible for an office 97

where is that line?
it's not in your snippet above

:O)Bruintje
0
 
ruddiAuthor Commented:
To bruintje
It on the place with the

>>>>> get stuck here >>>>>    Excel.Visible = No

Whether I read No or False is not important
 
0
 
ruddiAuthor Commented:
To bruintje
It on the place with the

>>>>> get stuck here >>>>>    Excel.Visible = No

Whether I read No or False is not important
 
0
 
ruddiAuthor Commented:
To bruintje
It on the place with the

>>>>> get stuck here >>>>>    Excel.Visible = No

Whether I read No or False is not important
 
0
 
bruintjeCommented:
sorry didn't see that

but you say false and no don't matter well then what about renaming Excel to objExcel or something shouldn't matter either but at least it throws a bit of confusion out of the code

what about trying to make it visible = true does that work or not? not that it should solve the problem but at least you can check if excel is created

also a bit of error handling around the code with a

on error goto errhandle

errhandle
  get the error message and number if possible

since i don't know how to do that in LS you should try that yourself but at least it could give some more insight in what error is being thrown
0
 
bruintjeCommented:
you can use the reload question button in the upper right corner to get the latest version of this Q
0
 
ruddiAuthor Commented:
To bruintje
It on the place with the

>>>>> get stuck here >>>>>    Excel.Visible = No

Whether I read No or False is not important
 
0
 
rkot2000Commented:
You may this problem due to shadowing:
Actually Excel is a root object  and it doesn’t have visible attribute so you should try like this.
Dim objExcel as object
Set objExcel = CreateObject("Excel.application")
ObjExcel.Visible =true
0
 
ruddiAuthor Commented:
Hello bruintje


I have put an errorhandler and the error I get is
error 207 automation object error

Making the visible = true  is not working neither.



And sorry but I don't know why the same remarks keep being posted time after time
0
 
rkot2000Commented:
If you have office 97, try to add references to excel and use object browser to check for this property.
0
 
ruddiAuthor Commented:
to rkot2000
I have changed Excel in objExcel as you asked but the error stayed.

What do you mean with "add references to excel and use object browser to check for this property"  ??

Sorry but I cannot understand
0
 
gencrossCommented:
rkot2000, this code is in Lotus Notes Script, not VB.  He probably does not have the same tools...

This is an interesting one.  I have checked MS KB and nothing.  Have you checked a Knowledge base about this at Lotus (or whoever owns Lotus Notes now.  Haven't kept up with it.)?
0
 
rkot2000Commented:
>>>rkot2000, this code is in Lotus Notes Script, not VB

ok open excel goto visual basic macro editor and select object browser :)
0
 
bruintjeCommented:
is excel correctly installed on the machine?
0
 
ruddiAuthor Commented:
to bruintje
>>>is excel correctly installed on the machine?
Yes. It opens fine if i just start it from programmenu

The code is totaly within lotus. So there is no object browser.

I have checked lotus groups. the same question is asked several times but no solution was found
0
 
rkot2000Commented:
>>The code is totaly within lotus. So there is no object browser.

but you have one with excel.

0
 
bruintjeCommented:
ok maybe far off but are your settings on that machine US  in the regional settings panel?
0
 
ruddiAuthor Commented:
to bruintje

The settings are Dutch Belgium in the regional settings
0
 
DanRollinsCommented:
Hi ruddi,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept bruintje's comment(s) as an answer.

ruddi, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.