LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I insert a picture into Excell in Labview6.1

I want to insert a picture in to my excell report from Labview front panel.
0 Kudos
Message 1 of 6
(4,246 Views)


Hello Boone,

We can divide your task into two main sub-tasks: First is getting the picture from your LV front-panel saved as an image to the disk (even if it's temporary).

Second is to insert this saved image into your Excel report.

For the first task, you may either use the Get Panel Image method on the VI which will capture the entire front-panel as an image. Or, use the Get Image method on a Control. For instance, you may use the Tab Control with its tabs hidden as a container for your picture. This way you can capture just the picture. Since I am on LabVIEW 7.0, I am attaching a screenshot which shows the first option (fpcaptre.png).

The seconds task of inserting this image in your Excel report is a l
ittle tricky. You basically use the ActiveX interface to Excel to do this. This involves opening an Automation refnum to Excel first, then to the ActiveWorkbook, and then to the ActiveSheet. On this ActiveSheet we call the AddPicture method under Shapes. This AddPicture method allows you to specify which picture, where in your Excel sheet you want to insert the picture, etc. Again, I am attaching a screenshot for this as well (addpicxl.png).

I am also attaching the VI for those with LV 7.0 (pastexcel.vi). Disclaimer: this VI was put together in a jiffy to demo the concepts only, it can definitely be improved further, blah blah blah 🙂

Hope this helps.

Regards,

Khalid


Download All
Message 2 of 6
(4,246 Views)
Hi Boone,

I have attached a VI built in LabVIEW 6i that inserts a picture into excel. This is actually an example program that will be going live on our website pretty soon.

I hope this helps.

Feroz
National Instruments
Message 3 of 6
(4,246 Views)
HiFerzP:
Thanks for your help a lot, but you don't include the subvi in your programming, could you give me you vi again?
Boone
China.SuZhou
0 Kudos
Message 4 of 6
(4,246 Views)
Hi Boone,

I should have mentioned that you need to have the Report Generation toolkit installed for the attached VI to load. The attached VI uses some VIs that come with the Report Generation Toolkit..

I am re-attaching the VI saved in 6i.

Sorry about the confusion. I hope this clarifies why the subVIs weren't found.

Sincerely,
Feroz
0 Kudos
Message 5 of 6
(4,246 Views)
Hi all:
Thanks for your help.
I find a way:
1.Copy a picture in copy Clipboard.
2.Past it into excel.
3.Move it to a specify loctaion.
Message 6 of 6
(4,246 Views)