LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

export xy graph to power point?

Solved!
Go to solution

Hi all,

 

My LabVIEW VI plots data using XY Graph. The VI makes several graphs. Is there a way to program the VI to open up a blank (or an existing) Power Point presentation and place each of these XY Graphs in

different pages of the Power Point?

 

0 Kudos
Message 1 of 31
(3,837 Views)
0 Kudos
Message 2 of 31
(3,827 Views)

Thank you Darin! Now if I were to group the three graphs in your VI, how do I export all three in the same page?

0 Kudos
Message 3 of 31
(3,820 Views)
Solution
Accepted by topic author murchak

There is a way to distribute and align them, but the quickest way would be to pull the Add Slide method out of the loop and only create slide 1.  Then give each graph the proper left and top increment to move it into the correct position.

Message 4 of 31
(3,816 Views)

Hi Darin,

 

One more question: I have my own ppt. template that I like to use and export the plots into that template. Your code has an automation refnum = PowerPoint._Application.

How do I create a reference to my file  (template) and use that in place of what you have in the code?

0 Kudos
Message 5 of 31
(3,763 Views)

After the Presentations.Add method you can apply the _Presentation.ApplyTemplate method to the new presentation reference (right before the current _Presentation.Slides property).  Supply the path to your template file and all of the created slides will use your template.

0 Kudos
Message 6 of 31
(3,744 Views)

Hi Darin,

 

How does your VI "know" to export the three plots to a Power Point presentation? I mean the three references you created are put into an array and fed to the Invoke Node (XYGraph (strict)) inside the for loop.

These references are not connected to anything else in the block diagram. So how does the rest of the code on the block diagram know to act on the three XY Graphs?

0 Kudos
Message 7 of 31
(3,703 Views)

Okay I think I got my answer and am still a little confused. Since you have another Invoke Node with class = Application, the default case (refnum not wired) should be the current application instance which I assume to be the three graphs(?). But you have this input wired and you called it PowerPoint._Application. How is this related to the three graphs? You see what I am confused about?

0 Kudos
Message 8 of 31
(3,697 Views)

The references are implicitly linked to the control with the same label.  Unless of course you do something silly like edit the label of a reference.   

Each iteration of the for loop copies one plot image to the clipboard and pastes it into PPoint.

 

Edit:

 

I see, the automation refnum.  That control is generated by right-clicking the automation open function and selecting the ActiveX class, in this case PP._Application.  It provides the type for the reference.  You can right-click that and make it a constant if you want.

0 Kudos
Message 9 of 31
(3,696 Views)

"The references (are these the three references XYGraph, XYGraph2, XYGraph3 AND the PowerPoint._Application connected to the Automation Open function?) are implicitly linked to the control (is this control the input of the Open Automation function?) with the same label (The XYGraph, XYGraph2, XYGraph3 are different labels that PowerPoint._Application. How are they implicitly linked?).  Unless of course you do something silly like edit the label of a reference.   

Each iteration of the for loop copies one plot image to the clipboard and pastes it into PPoint.

 

Edit:

 

I see, the automation refnum.  That control is generated by right-clicking the automation open function and selecting the ActiveX class, in this case PP._Application.  It provides the type for the reference.  You can right-click that and make it a constant if you want.

0 Kudos
Message 10 of 31
(3,687 Views)