![]() |
Telelogic Rhapsody (steve huntington) | ![]() |
Topic Title: How to access VBE from outside Rhapsody? Topic Summary: Created On: 1-Jul-2005 20:27 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Within VBA in Rhapsody I can use an object called VBE, which allows me to access the VBA modules that exist in the current project (quite useful if you want to check that all necessary VBA modules have been loaded).
Now what I want to do is access that VBE object from outside Rhapsody, specifically from Word VBA, so that I can supply a Word document that installs modules into the Rhapsody VBA. Problem is, from Word I don't know how to get hold of the VBE object that is within Rhapsody. (Obviously, I can access the Word-VBA's VBE object, but that's not the one I want.) I note (from Object Inspector in Rhapsody) that there is a VBE property of the RPHApplication class, but that isn't accessible from an object I create with something like GetObject("Rhapsody.Application") ... which gets the application object of the currently-open Rhapsody project. Probably the application object has an RPApplication interface, but not an RPHApplication interface. Any ideas on how to get hold of the VBE object, or something with an RPHApplication interface that would give me a VBE object? |
|
![]() |
|
![]() |
|
' get the application of an open Rhapsody
Dim hRhapAppl As RPApplication Set hRhapAppl = GetObject(, "Rhapsody.Application") ' Use CreateInstance if Rhapsody is not open |
|
![]() |
|
![]() |
|
Hi Amos,
Thanks for your reply, but I think you may have missed some of the complication of my question in regard to the VBE object. The code in your reply to get an RPApplication object is fine, but as I mentioned in my original posting if you use such code to initialise, say, hRhapAppl, then hRhapAppl.VBE does not yield the VBE object. What I'd like to be able to do is something like: [CODE]Public Sub getVBE() ' get the application of an open Rhapsody Dim hRhapAppl As RPApplication Set hRhapAppl = GetObject(, "Rhapsody.Application") Dim hVBE As Object Set hVBE = hRhapAppl.VBE 'Use the hVBE to access things like VBProjects etc. End Sub [/CODE] But I can't do this because hRhapAppl doesn't have a VBE object, so the line [CODE]Set hVBE = hRhapAppl.VBE[/CODE] produces an error "Object doesn't support this property or method". Any more thoughts? |
|
![]() |
|
![]() |
|
Anyone got any ideas on how to access the VBE object from outside, as per previous post?
|
|
![]() |
Telelogic Rhapsody
» Rhapsody Category » Rhapsody
»
How to access VBE from outside Rhapsody?
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.