LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Report Generation Toolkit Makes Excel Flash Annoyingly

Solved!
Go to solution

@Gregory wrote:

If I open "Excel Insert Graph.vi" and then open "Excel_Insert_Chart.vi" I see that it checks at the beginning if the window state is "xlMinimized". If it is, then it sets it back to minimized at the end. So, I'm inclined to agree with James that this is expected behavior of using ActiveX to insert an OLEObject.


Yep, after a quick trial here, I am experiencing the same thing.  From what I quickly read, these are embedded objects, not the typical Excel graphs used if you insert a graph from the UI.  

aputman
0 Kudos
Message 11 of 24
(3,087 Views)
Solution
Accepted by topic author Gregory

Here is a way to do it without using OLE Objects.  I confirmed that this method does not flash up the excel window when inserting the graph and it uses the build in charts (much nicer looking charts).  I quickly generated data and hardcoded the range of the data but you could easily create this range programmatically using your data.

 

chart_BD.png

 

 

aputman
Message 12 of 24
(3,074 Views)

Thank you very much Aputman. It took me a while to figure out how to add titles and plot non-adjacent columns, but now I am really happy with the result. I went ahead and marked yours as the solution. Here is my revised "Make Graph" VI if anyone is interested:

 

Make Graph.png

Message 13 of 24
(3,048 Views)

@aputman wrote:

Here is a way to do it without using OLE Objects.  I confirmed that this method does not flash up the excel window when inserting the graph and it uses the build in charts (much nicer looking charts).  I quickly generated data and hardcoded the range of the data but you could easily create this range programmatically using your data.

 

chart_BD.png

 

 


Can you please post this VI in LV 2011 format?

Now on LabVIEW 10.0 on Win7
0 Kudos
Message 14 of 24
(2,843 Views)

Hi aputman,

 

I looked at your example below. I was able to create Excel._Chart (thanks for the help). From here, I cannot duplicate what you have below (I see the "Variant to Data" data output is connected to ChartObjects below which you have Add method, which is connected to ChartObject which is the Chart method)

 

I right-clicked on the "data" output of the Variant to Data -> create -> methods -> ChartObjects which puts a "_Charts" node on the block diagram with CharObjects and Index below that. (see attached pic). I just cannot find the Add method like you have in your post.

 

 

 

0 Kudos
Message 15 of 24
(2,660 Views)

All the images posted are Snippets and are executable code, no need to re-write what you see.

0 Kudos
Message 16 of 24
(2,624 Views)

@murchak wrote:

Hi aputman,

 

I looked at your example below. I was able to create Excel._Chart (thanks for the help). From here, I cannot duplicate what you have below (I see the "Variant to Data" data output is connected to ChartObjects below which you have Add method, which is connected to ChartObject which is the Chart method)

 

I right-clicked on the "data" output of the Variant to Data -> create -> methods -> ChartObjects which puts a "_Charts" node on the block diagram with CharObjects and Index below that. (see attached pic). I just cannot find the Add method like you have in your post.

 

 

 


 

Could you turn on the labels for the blocks in your diagram or upload that VI? I was going to try to rebuild your code, but I am not sure what blocks you are using. 

Chase
NI Technical Support Engineer
0 Kudos
Message 17 of 24
(2,607 Views)

Those images are snippets.  They have the code embedded in the image file.  Save the image to your desktop and then drag it onto a block diagram and the code magically appears (assuming you have the RGT installed).  No need to re-code it.

 

You may notice the "LV: 12.0" in the upper left corner of the image.  This is the version of Labview used to create the snippet.  If your version is the same or newer, the snippet will work for you.  If not, a LV11.0 version of this code was posted in this thread.  

aputman
0 Kudos
Message 18 of 24
(2,600 Views)

Can you take a screenshot of that area? I drug the snippet into LabVIEW, and the option was there for me to do it. 

Chase
NI Technical Support Engineer
0 Kudos
Message 19 of 24
(2,594 Views)

The fact that you had to google how to make a screen shot means you didn't read the link I provided.  Go to your block diagram, press CTRL+A, go to Tools >> Create VI Snippet from selection.  This image is now executable code.  Taking a screenshot of your whole computer and showing potentially private information probably isn't what you want (like knowing you use lotus notes).

 

It looks like you were able to open the snippet, and it looks like you have the Add method, for the Chart Object, what seems to be the problem?

0 Kudos
Message 20 of 24
(2,586 Views)