YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Open TimeRange Popup via VBA Options · View
tompkins
#1 Posted : Wednesday, December 29, 2010 1:18:52 PM
Rank: Member
Groups: Member

Joined: 12/29/2010
Posts: 10
Hi,

is it possible to open then standard menu-popup for changing the time range from the "Time Range Toolbar" via vba?

tompkins
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
RJK Solutions
#2 Posted : Wednesday, December 29, 2010 4:03:11 PM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
Hello,

Welcome to the forum.

You can simulate the menu item being clicked in VBA:

Code:

Sub SimulateClickTimeRange()

Dim cb As PBCommandBar
Set cb = Application.CommandBars("Time Range Toolbar")
    Dim c As PBCommandBarControl
    Set c = cb.FindControl(, 32786)
        c.Execute
    Set c = Nothing
Set cb = Nothing

End Sub


Just be sure to consider that if you have any symbols selected then the time range is applied to those symbols. You may need to call "ThisDisplay.Symbols.RemoveAll" if you want to set the Display object time range.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
tompkins
#3 Posted : Thursday, December 30, 2010 7:40:24 AM
Rank: Member
Groups: Member

Joined: 12/29/2010
Posts: 10
This works perfect, thank you!
tompkins
#4 Posted : Thursday, December 30, 2010 12:04:17 PM
Rank: Member
Groups: Member

Joined: 12/29/2010
Posts: 10
How is the event called after the TimeRange is changed via menu?

Something like "Display_AfterTimeRangeChange(...)" maybe?
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.