Message 1 of 5
kUnknownDocumentObject- Odd Error

Not applicable
05-22-2003
07:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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-
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-