Hi, hope you can help me with this VBA enhancement. I am working on a project using the application PI. It utilizes VBA similarly to Excel etc.
This is the situation, I have a main page and there are rectangular boxes that when I click on, will take me to a "display" (graph or trend). Right now, I have like 12 boxes, and I am naming all 12 boxes and creating a click event for each. i.e.
"Public Sub SCV_Phos_Abs_Lnk_Click(ByVal lvarX As Long, ByVal lvarY As Long)
LinkTo "SCV Trends", "Phos_Abs_Hi_Press"
End Sub
----------
Public Sub SCV_Phos_Abs_Lnk_MouseOut()
SCV_Phos_Abs_Lnk.LineStyle.Weight = 1
SCV_Phos_Abs_Lnk.LineColor = RGB(0, 0, 0)
End Sub
-------------
Public Sub SCV_Phos_Abs_Lnk_MouseOver()
SCV_Phos_Abs_Lnk.LineStyle.Weight = 2
SCV_Phos_Abs_Lnk.LineColor = RGB(0, 0, 255)
End Sub"
where "LinkTo" is a procedure I created, and "SCV Trends is the name of the display page and "Phos_Abs_Hi_Press" is the name of one of the 12 displays on that page.
Instead of having 12 of those, is there a way to generalize the code and make it like kinda web browsing.......where I don't have to name each link?
Thanks!
This is the situation, I have a main page and there are rectangular boxes that when I click on, will take me to a "display" (graph or trend). Right now, I have like 12 boxes, and I am naming all 12 boxes and creating a click event for each. i.e.
"Public Sub SCV_Phos_Abs_Lnk_Click(ByVal lvarX As Long, ByVal lvarY As Long)
LinkTo "SCV Trends", "Phos_Abs_Hi_Press"
End Sub
----------
Public Sub SCV_Phos_Abs_Lnk_MouseOut()
SCV_Phos_Abs_Lnk.LineStyle.Weight = 1
SCV_Phos_Abs_Lnk.LineColor = RGB(0, 0, 0)
End Sub
-------------
Public Sub SCV_Phos_Abs_Lnk_MouseOver()
SCV_Phos_Abs_Lnk.LineStyle.Weight = 2
SCV_Phos_Abs_Lnk.LineColor = RGB(0, 0, 255)
End Sub"
where "LinkTo" is a procedure I created, and "SCV Trends is the name of the display page and "Phos_Abs_Hi_Press" is the name of one of the 12 displays on that page.
Instead of having 12 of those, is there a way to generalize the code and make it like kinda web browsing.......where I don't have to name each link?
Thanks!