Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Driving DOORS from MSWord via OLE
Topic Summary:
Created On: 22-Oct-2004 12:16
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Ross Morgan, on Friday, October 29, 2004 1:58 PM

Answer:
set DOORSObj = nothing
clears the object reference

Dim appDoors as Object
Private Function connectToDOORS() As Boolean
On Error GoTo connectHandler
Dim sErrMsg As String
Set appDoors = CreateObject("DOORS.Application")
connectToDOORS = True
Exit Function
connectHandler:
sErrMsg = "Unable to communicate with DOORS." + vbCrLf + _
"DOORS must be started, and you must have opened a project or folder"

MsgBox prompt:=sErrMsg, Buttons:=vbCritical
connectToDOORS = False
End Function
Private sub disconnectDOORS()
set appDoors = nothing
end sub
 22-Oct-2004 12:16
User is offline View Users Profile Print this message


Paul Worrall

Posts: 87
Joined: 30-Sep-2003

Hi,

I am trying to connect to a currently active DOORS session from Word, and run some DXL. The following VBA works OK, but only the first time it is run, on subsequent attempts it returns the error:

"Run-time error 429: ActiveX component can't create object"

I'm wondering if I need to somehow "release" the reference to the DOORS.Application object at the end of the Sub?
Report this to a Moderator Report this to a Moderator
 22-Oct-2004 13:46
User is offline View Users Profile Print this message


Ross Morgan

Posts: 74
Joined: 15-Apr-2004

Answer Answer
set DOORSObj = nothing
clears the object reference

Dim appDoors as Object
Private Function connectToDOORS() As Boolean
On Error GoTo connectHandler
Dim sErrMsg As String
Set appDoors = CreateObject("DOORS.Application")
connectToDOORS = True
Exit Function
connectHandler:
sErrMsg = "Unable to communicate with DOORS." + vbCrLf + _
"DOORS must be started, and you must have opened a project or folder"

MsgBox prompt:=sErrMsg, Buttons:=vbCritical
connectToDOORS = False
End Function
Private sub disconnectDOORS()
set appDoors = nothing
end sub
Report this to a Moderator Report this to a Moderator
 29-Oct-2004 13:58
User is offline View Users Profile Print this message


Paul Worrall

Posts: 87
Joined: 30-Sep-2003

Thanks for the help and sorry for the delay in response (I've been on leave). The key to the solution appears to be the use of CreateObject rather than GetObject though I don't understand why. The Visual Basic help pages say you should use CreateObject when there is no current instance of the object and GetObject (with the pathname argument omitted) to get a currently active object of the specified type. I presumed that if DOORS is already running then that counts as a currently active object of the type "DOORS.Application".
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.