I'd like to give an information of a ProcessBook to another ProcessBook using VBA, thank you. (Eu gostaria de dar uma informação de um ProcessBook para outro ProcessBook usando VBA, obrigado.)
Considering that the display source is already open.
Private Sub Display_DataUpdate()
Dim D As Display
On Error GoTo Msg1
Set D = Application.Displays("SOURCE") ‘Display where the value to be copied
A = D.Symbols("VALUE_1").GetValue("*",Null) ‘Dataset 1
B = D.Symbols("VALOR_2").GetValue("*", Null) ‘Dataset 2
C = A + B
ThisDisplay.TEXT1.Contents = C
E = D.Symbols("VALOR_3").Contents 'Textbox
ThisDisplay.TEXT2.Contents = E
MsgBox ("Open the display SOURCE") 'If display SOURCE isn't open
Bruno, what kind of specific information are you looking to pass between your two ProcessBooks? Are these two ProcessBook .PIW files, or two independent display .PDI files?
I'm looking for PDI to another PDI, two independent display. The information can be a text box or something that I can use in VBA !
Through VBA you still have access to the automation model so you can do anything you like as if you are dealing with your current display (aka ThisDisplay object).
Example, if you have two displays - display1.pdi and display2.pdi - and there is a Value symbol on Display1 that you want to access from Display2 then you could do something as simple as:
Dim d As Display
Set d = Application.Displays.Open("C:\Apps\Display1.pdi", True)
Debug.Print d.Symbols("Value1").GetValue("*", Null)
Of course you can access public variables from VBA code, other complex symbols etc.
Hi Gilson Gilson Oliveira
I know its too old post but I have a question in the same topic,
I'm trying to get values of textboxes from display 1 and store them in textboxes in display 2, I was able to store Values of tags from display 1 and assign them to in display 2 (Use variables in display macro from another display's macro)
but it didn't work with textboxes from display 1 to display 2.
Any help please?
Retrieving data ...