Error occurred while accessing component property/method: <property or method name>"

DivyaRajesh

New Member
Hi,

I am getting the below error when I try writing a simple program which will display the report in excel

"Error occurred while accessing component property/method: <property or method name>"

when I try looking for details using the message number, I get the below description
"An error occurred while trying to get or set a property via a com-handle or while calling a method via a com-handle. The error code may be looked up in the documentation. COM message should also give more information. "

Can anyone tell me where to look for the documentation on COM mesasges?
 

Cringer

ProgressTalk.com Moderator
Staff member
Re: Error occurred while accessing component property/method: <property or method nam

Try taking the error message as it appears (so with the com message number) and googling it. Alternatively post the message here and someone might be able to help.
 

sphipp

Member
Re: Error occurred while accessing component property/method: <property or method nam

What this means is that you have an invalid COM handle.

Normally, you get this by trying to refer to a COM handle that you haven't yet created.

So, if you want to create a Chart in Excel but don't create the Chart COM-Handle, if you then try and do something with the Chart COM-Handle you'll get this kind of message.

Is this a new program or has an existing report stopped running?

If it's a new program you have probably forgotten to do something, if the program already exists and has suddenly stopped working, it's worth seeing if anything has changed, particularly versions of Excel or installation paths.

From the post, it looks as though this is a new program. That makes it easier to find where the error is. I normally use MESSAGE VIEW-AS ALERT-BOX liberally sprinkled around the code, normally just before and just after I try doing things in Excel etc so that I can get messages such as "Before Excel create", "After excel create", "Before Worksheet Create", "After Worksheet create" and so on, so I can pinpoint exactly where the error occurs.

Once you know where the error is then you can usually have a good go at working out why the error occurs.
 

DivyaRajesh

New Member
Re: Error occurred while accessing component property/method: <property or method nam

I got this message while running an existing code. It suddenly stopped working. We re-installed MS-escel and its working fine.

Thanks for your replies
Divya
 
Top