FTV SE VBA Display Names

JonAW

Member
Join Date
Sep 2013
Location
Somewhere
Posts
121
Hi Guys,

Just a quick question.

I can't seem to be able to change the display names in vba. All my screens (in VBA) are named DisplayCode.ThisDisplay. Is there anyway I can change this so I can reference items on another display?

thanks

Jonny
 
Hi Guys,

Just a quick question.

I can't seem to be able to change the display names in vba. All my screens (in VBA) are named DisplayCode.ThisDisplay. Is there anyway I can change this so I can reference items on another display?

thanks

Jonny

Yes. Reference the other display by name, it has to have a unique name in the project.

In VBA on the display that you want to reference from, declare the following as globals:

Code:
Dim oDS As Displays
Dim oMyOtherWindow as Display

Then resolve them at the start of animation...

Code:
Public Sub Display_AnimationStart()

   Set oDS = LoadedDisplays
   Set oMyOtherWindow = oDS.Item("MyOtherWindowName")

End Sub
To use or reference any item on your other display, use the dereferenced object:

Code:
oMyOtherWindow.SomeButton.Caption = "New Caption"
...

FTView goes out of its way to make any simple task difficult.
 
Last edited:
Thanks RDRast. I've already tried to rename the DisplayCode to another name but when I exit the VBA editer and open it again the name reverts back to DisplayCode. have you any idea why this could be happening?
 
Thanks rd, I've just come across another post on the forum by yourself that I'm following through now.

I was following the naming of the macros in the VBA editor which lead me to believe the DisplayCode needed to change. Anyway I'm on the right path now.

thanks again.

Jonny
 
I like Change the Display Name in VBA from DisplayCode to a other Name for reference. I displayed always a Header, in the Header i created same Moduls and now i will use the moduls from all other Display. is it posible?
 

Similar Topics

Can you help me with the following? I know when creating an expression using the "display" command I can use different switches to cause the...
Replies
0
Views
1,018
Anybody know of a complete (or relatively complete) resource for VBA functions available to FTV SE? I know there are specific functions and...
Replies
6
Views
1,589
Dear SIR , We are having some problem regarding VBA code for FTV 8.10. We had a project in which we had to convert the old SCADA RSVIEW 32 with...
Replies
0
Views
1,681
I’m trying to disable a button after a popup is opened using VBA. It works and the button looks disabled but I can keep clicking the button until...
Replies
5
Views
2,165
Back
Top Bottom