LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a shape to an excel chart?

Solved!
Go to solution

Does anyone have experience doing advanced plotting on an excel chart?  I tried to add a shape using Excel_ShapesAddShape, but couldn't make it work.  Where can I find such examples?  Thank you.

0 Kudos
Message 1 of 5
(5,481 Views)

Have a look at this:

http://www.ni.com/tutorial/5835/en/

In particularly the 'Adding a Graph' section.

0 Kudos
Message 2 of 5
(5,476 Views)

Thanks for the reply, Daniel.  The tutorial is for basic excel functions that uses excelreport.fp.  For advanced excel graphing such as adding shapes/textboxes, I think functions in excel2000.h are needed.

 

Here is an example: plot a line in a chart.  But the line doesn't show up.  Do I miss any other functions to define or set attribute of the line (shapeHandle)?

 

Excel_ShapesAddLine (chartHandle, NULL, 100, 100, 100, 100, &shapeHandle);

 

Thanks a lot.

0 Kudos
Message 3 of 5
(5,444 Views)
Solution
Accepted by topic author jzhu0000

This forum post is related:

http://forums.ni.com/ni/board/crawl_message?board.id=180&message.id=47510

and mentions writing a VBA script that will draw the shape to call in CVI:

https://msdn.microsoft.com/en-us/library/aa221611(office.11).aspx

 

This forum post is also related and seems helpful

http://forums.ni.com/ni/board/crawl_message?board.id=180&message.id=52934

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 4 of 5
(5,421 Views)
Solution
Accepted by topic author jzhu0000

The last link is very helpful.  I get it.  Thanks a lot, Maggie!

0 Kudos
Message 5 of 5
(5,415 Views)