|
|
Rank: Newbie Groups: Member
Joined: 11/29/2010 Posts: 9 Location: DK
|
Hi All.
I have a spreadsheet, with about 15 to 20 trends on it. Is it possible, to change all the different trend titles, with some VBA code, when I press a button ?.
I need to do this because, I need the spreadsheet to be bilingual.
Hope someone can help me out here.
We use PI link V.4.1.1 and Excel 2007
Best regards from.
Chris
|
|
|
|
|
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.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Hi Chris, Welcome to the forum. Here is some sample code I put together, it is within the context of an Excel worksheet but no reason you can't roll it up to a workbook level. Code: Sub ChangeTitles()
Dim i As Integer For i = 1 To Me.OLEObjects.Count If Me.OLEObjects(i).progID = "PITrend.PITrend.1" Then Dim TC As TrendConfig Set TC = Me.OLEObjects(i).Object.GetConfiguration TC.Title.Text = "RJK Solutions is cool." Me.OLEObjects(i).Object.SetConfiguration TC Set TC = Nothing End If Next i
End Sub
Enjoy! Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Newbie Groups: Member
Joined: 11/29/2010 Posts: 9 Location: DK
|
Hi. THANKS for the sample code, it was just the kick starter i needed I have made a Select case in the code, and use that to "grap" the trends I want to change the title on, is that a bad way of doing it ? Best regards from. Chris
|
|
|
|
Guest
|