02-21-2013 04:57 PM
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?
Solved! Go to Solution.
02-21-2013 05:26 PM
02-21-2013 06:18 PM
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?
02-21-2013 06:34 PM
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.
03-17-2013 07:36 PM
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?
03-18-2013 12:23 PM
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.
03-28-2013 02:23 PM - edited 03-28-2013 02:24 PM
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?
03-28-2013 02:31 PM
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?
03-28-2013 02:37 PM - edited 03-28-2013 02:42 PM
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.
03-28-2013 03:04 PM
"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.