kUnknownDocumentObject- Odd Error

kUnknownDocumentObject- Odd Error

Anonymous
Not applicable
279 Views
4 Replies
Message 1 of 5

kUnknownDocumentObject- Odd Error

Anonymous
Not applicable
Hi!

I'm making a VB-program, which makes for exsamble bom directly to excel-
sheet. I keep having problems with code:

Dim oApprentice As New ApprenticeServerComponent
Dim oDoc As ApprenticeServerDocument
Set oDoc = oApprentice.Open(Avoinkuva)
Dim oCompDef As ComponentDefinition
Set oCompDef = oDoc.ComponentDefinition
Dim sMsg As String
Dim iLeafNodes As Long
Dim iSubAssemblies As Long
' Get all occurrences from component definition for Assembly document
Dim oCompOcc As ComponentOccurrence
For Each oCompOcc In oCompDef.Occurrences
Rivejä = Rivejä + 1
' Check if it's child occurrence If oCompOcc.SubOccurrences.Count =
0 Then '<-this line returns error below
..............

Run-time error'-2147467259(80004005)'
Method'SubOccurences'of object'_IRxComponentOccurrence'failed

I send "locals"-window printscreen to CF under same topic
Some days this works fine, even with same assembly. Today, no hope :`(
The assembly im working with is totally ok IMO!
Any ideas? What could possibly cause this error, and what could i do to
prevent this?
Any help is appreciated!

-Alpo-
0 Likes
280 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
I find that there are a few ways around this. First shut down and restart
the computer. Try rebuilding all from the top level assembly. Run the
assembly through the migration assistant with the rebuild checked and the
skip migrated files unchecked.

Kathy Johnson
0 Likes
Message 3 of 5

Anonymous
Not applicable
Hi Kathy!

Thanks a lot for your advice! I restarted the computer, and tried again.
Program runs trough without any errors! I suppose that was all i need to do
to this problem! There must be something left in memory, while that
assembly were open in inv and then closed. Lets see what tomorrow brings!

-Alpo-
0 Likes
Message 4 of 5

Anonymous
Not applicable
Seems like I have ran into situations like this with IV a couple of times,
especially when using the API. My assumption is that there is some type of
error in the API code. Has anyone else found similar situations?

EdT



"Alpo Siekkinen" wrote in message
news:oprpmkkeo8xs4e9c@discussion.autodesk.com...
> Hi Kathy!
>
> Thanks a lot for your advice! I restarted the computer, and tried again.
> Program runs trough without any errors! I suppose that was all i need to
do
> to this problem! There must be something left in memory, while that
> assembly were open in inv and then closed. Lets see what tomorrow brings!
>
> -Alpo-
0 Likes
Message 5 of 5

Anonymous
Not applicable
I have in the past trying to iterate through an assembly. The problem is
one time it will work on an assembly then an immediate repeat will have
errors. Thankfully the errors disappear using the process I said near the
beginning. It has happened on migrated assemblies to IV6 and native
assemblies in IV6. I have not tried my routine on IV7 yet so I can't say if
it is still around.

Kathy Johnson
0 Likes