Solved

Automation object error when going from lotus notes to excel 97

Posted on 2002-06-20
24
1,743 Views
Last Modified: 2012-06-21
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"
     

0
Comment
Question by:ruddi
  • 9
  • 6
  • 5
  • +3
24 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 7095823
maybe Excel.Visible = false
0
 
LVL 4

Expert Comment

by:gencross
ID: 7095837
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
 

Author Comment

by:ruddi
ID: 7095881
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
 
LVL 44

Expert Comment

by:bruintje
ID: 7096130
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
 

Author Comment

by:ruddi
ID: 7096189
To bruintje
It on the place with the

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

Whether I read No or False is not important
 
0
 

Author Comment

by:ruddi
ID: 7096202
To bruintje
It on the place with the

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

Whether I read No or False is not important
 
0
 

Author Comment

by:ruddi
ID: 7096229
To bruintje
It on the place with the

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

Whether I read No or False is not important
 
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7096236
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
 
LVL 44

Expert Comment

by:bruintje
ID: 7096270
you can use the reload question button in the upper right corner to get the latest version of this Q
0
 

Author Comment

by:ruddi
ID: 7096281
To bruintje
It on the place with the

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

Whether I read No or False is not important
 
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 7096351
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
 

Author Comment

by:ruddi
ID: 7096354
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 5

Expert Comment

by:rkot2000
ID: 7096367
If you have office 97, try to add references to excel and use object browser to check for this property.
0
 

Author Comment

by:ruddi
ID: 7096477
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
 
LVL 4

Expert Comment

by:gencross
ID: 7096487
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
 
LVL 5

Expert Comment

by:rkot2000
ID: 7096500
>>>rkot2000, this code is in Lotus Notes Script, not VB

ok open excel goto visual basic macro editor and select object browser :)
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7096509
is excel correctly installed on the machine?
0
 

Author Comment

by:ruddi
ID: 7096668
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
 
LVL 5

Expert Comment

by:rkot2000
ID: 7096679
>>The code is totaly within lotus. So there is no object browser.

but you have one with excel.

0
 
LVL 44

Expert Comment

by:bruintje
ID: 7096775
ok maybe far off but are your settings on that machine US  in the regional settings panel?
0
 

Author Comment

by:ruddi
ID: 7097931
to bruintje

The settings are Dutch Belgium in the regional settings
0
 
LVL 44

Accepted Solution

by:
bruintje earned 200 total points
ID: 7099241
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
 
LVL 49

Expert Comment

by:DanRollins
ID: 7923650
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
 

Expert Comment

by:SpideyMod
ID: 7968400
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now