Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic Rhapsody (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
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.
 1-Jul-2005 20:27
User is offline View Users Profile Print this message


Charlie Lane

Posts: 18
Joined: 11-May-2005

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?
Report this to a Moderator Report this to a Moderator
 17-Aug-2005 10:57
User is offline View Users Profile Print this message


Amos Ortal

Posts: 120
Joined: 22-Jul-2004

' get the application of an open Rhapsody
Dim hRhapAppl As RPApplication
Set hRhapAppl = GetObject(, "Rhapsody.Application")
' Use CreateInstance if Rhapsody is not open
Report this to a Moderator Report this to a Moderator
 22-Aug-2005 08:15
User is offline View Users Profile Print this message


Charlie Lane

Posts: 18
Joined: 11-May-2005

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?
Report this to a Moderator Report this to a Moderator
 29-Aug-2005 11:25
User is offline View Users Profile Print this message


Charlie Lane

Posts: 18
Joined: 11-May-2005

Anyone got any ideas on how to access the VBE object from outside, as per previous post?
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic Rhapsody forum.
There are currently 1 users logged in.
You have posted 0 messages to this forum. 0 overall.

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