![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() 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 | |
![]() |
|
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? |
|
![]() |
|
![]() |
|
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 |
|
![]() |
|
![]() |
|
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".
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Driving DOORS from MSWord via OLE
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.