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

How to embed an excel worksheet in PI procee book display using VBA? Options · View
cheche
#1 Posted : Friday, January 28, 2011 12:52:03 AM
Rank: Newbie
Groups: Member

Joined: 1/15/2011
Posts: 3
Location: Canada
I am new to the programming in PI process book environment using vba. I tried to get data from PI server and then open a new display and embed an excel worksheet in the display. Then I want to input data into the excel worksheet. However, I know how to open a new display but don't know how to embed an excel worksheet in the display. Does anyone know how to do it? Thank you for any help in advance.
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 : Friday, January 28, 2011 1:59:32 PM
Rank: Administration

Groups: Administration

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

Take a look at this discussion: http://www.rjksolutionsltd.co.uk/forum/yaf_postst440_Embedding-an-Excel-Chart-into-PI-ProcessBook-Display.aspx

Principal Consultant
Real-Time Data Management @ Wipro Technologies
cheche
#3 Posted : Friday, January 28, 2011 4:43:27 PM
Rank: Newbie
Groups: Member

Joined: 1/15/2011
Posts: 3
Location: Canada
Thank you for the reply. I read the post you suggested but didn't find the answer. I want to embed a excel worksheet in an added PI process book display and then manipulate the worksheet to input data. Actually, I didn't receive any training about PI process book. Now I am learning by myself.
My code is:
Code:

    Dim docs As Displays
    Set docs = Application.Displays
    docs.Add ("newdisplay")Dim docs As Displays
    Set docs = Application.Displays
    docs.Add ("newdisplay")
    Dim oleObj As OLEObject
    Set oleObj = ThisDisplay.OLEObjects.Add(classtype:="excel.application.workbook", Filename:="sheet", link:=False, displayasicon:=False, Left:=Left, Top:=Top, Width:=Width, Height:=Height)
   


The code does not work. Can anyone help me to check it?
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.