Error -2147418113 (8000ffff)

M

Matt McQueen

I have managed to produce this error after trying to set the focus of an
option button within a frame on a multipage form. It also says: "Unexpected
call to method or property access."

When I've had this error in the past, the only way I've found to fix it is
to start again with the form. In this case however I'm reluctant since it
would involve considerable work.

Does anyone have more info on this? The web appears to be devoid of relevant
info. A fix would be even better...

Cheers,

Matt
 
J

Joel

You could try to export the userform and then input into another workbook.

In the VBAProject window right click the userform and then export.

To import form
In the VBAProject window right click the FORMS and then import.
 
M

Matt McQueen

Joel,

Nix. Error stays the same. This was true the last time I had a similar
problem too (i.e. exporting didn't do anything). Literally the only way I
could get around it was to build the form from scratch. It's something to do
with the order in which controls are added to a form, and maybe within a
frame. Basically you need all of the controls in place before you start
writing code that controls how they affect each other. I suppose that's just
good practice... but it's frustrating since I tend to iterate quite a bit.

Cheers,

Matt
 
J

Joel

The export file is text. You can edit the file and possible isolate where
the problem is located.
 
J

Joel

I know I've seen this problem before and have always been able to fix the
problem. The technique I use to debug Userforms is I put a break point on
the Sub line of each of the routines in the userform by click the SUB line
and ten pressing F9.

Next I start the userform the way I normally start the userform. When the
code stops on the SUB line I press F5 to continue. The last SUB that you
reach the break point before you get your error is the routine with the
problem. I then repeat the process but instead of pressing F5 when I get to
the LAST routine I step through the code using F8.

If you get the error without getting to a break point then try adding an
initialize function to the userform and breaking on the Initilize function.
if you get an error then the Userform is corrupted. Removing items from the
userform will help isolate the problem.

I think if you build the userform again you may end up with the same problem.
 
M

Matt McQueen

Joel - how does your approach differ from clicking 'debug' in the VBA error
dialog? I know the problem comes when I try to setfocus on a control in a
different frame.

I had a look at the text in the .frm file, but couldn't see anything wrong
(most of it is the code I wrote). I don't know how to look at the .frx file -
it's encoded.

I wrote some code to copy the form (i.e. as if I was building the form at
run time) and then exported it. It produced an error, but the error was
different this time (-2147467259 (80004005) - unspecified error).

In the end I've solved this issue by setting the focus in a different
routine. However I really would like to know what creates this problem. I did
find someone else refering to the issue:

http://www.pcreview.co.uk/forums/thread-3306817.php

but there were no responses.
 
J

Joel

I have run into run time errors where the debug dialog didn't stop on a line
of code when I user the .Show. Just gave me an error without letting me know
where the error occured. i thought you had the sam etype problem.

Userforms are set by default to Private. The Private class restricts access
to object between diffferent classes (in this case userforms). You could try
changing you routine to public and see if that works.

I'm not sure but I think your problem is the userform is loaded into a
different area of memory that you don't have access to.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top