FactoryTalk View SE VBA QOL Improvement

MikeyN

Lifetime Supporting Member
Join Date
Dec 2017
Location
Illinois
Posts
289
Hello group,

I have been migrating a project from RSView 32 V7.6 to FactoryTalk View SE Local Station V12 over the last couple of days. All told, it has gone quite well all things considered. I have one minor complaint that I can't seem to figure out. Is it possible to have a new VBA Sub insert itself into the bottom of the editor rather than between my Option Explicit and Private Sub Display_AnimationStart() at the top? I would like to have the animation subs at top, my function below those, and then all of my pushbuttons at the bottom. I have over 70 buttons that are going to send parameters to my function, and it is really annoying to have to cut and paste constantly, especially as my document gets longer. I am replacing rectangles that used to be used as pushbuttons with pushbuttons one at a time since polygons don't have a "released" property. Since there are so many buttons, I am adding them one at a time, and then doing the VBA for each as I go.

For example:
Code:
Option Explicit
Dim gpGroup As TagGroup

[COLOR="Red"]New Subs insert here automatically[/COLOR]

Private Sub Display_AnimationStart()
On Error GoTo Blah
Dim things
Do Stuff
Exit Sub
Blah:
log my error
End Sub

Private Sub Display_BeforeAnimationStop()
Do More things
End Sub

Private Function OneFunctionToDoLiterallyEverything(P1 as String, P2 as Integer)
Do function things
End Function

Private Sub Button1_Released()
Button sends parameters to function.
End Sub

[COLOR="Blue"]This is where I would like new subs to be inserted.[/COLOR]

Is there an option somewhere that will automatically insert new items in the blue area? It should be mentioned that I have been adding the buttons to the screen, right clicking the new button and then selecting VBA Code... so that it sets the ExposeToVBA property automatically for me. I guess I am just looking for the laziest way to do this.
 

Similar Topics

I'm creating an HMI that has a recipe with 288 data point. It has 3 pieces of data for 96 segments. I need help with VBA code to copy all 288...
Replies
0
Views
142
Hi, Can someone guide me through how to use FactoryTalk SE VB script to open communication with SQL Server? which command I can use? Are there...
Replies
2
Views
2,304
For trend charts, I can use an ActiveX Calendar control to select a date on a trend using the following code where "Trend" is the name of the...
Replies
2
Views
1,583
Anyone know how to change the mouse icon to something else using VBA? It looks like it can be done with VBA forms and based on the object the...
Replies
0
Views
2,218
Hi guys i have troubles getting the selected item properties in FTV Alarms and Events. I have this "Alarm and Event Summary" which displays my...
Replies
3
Views
4,431
Back
Top Bottom