03-01-2006 01:29 PM
03-01-2006 06:06 PM
Hello,
I was able to reproduce this problem in both LabVIEW 7.1 and 8.0, with both Office XP and 2003. I'm still investigating, but it looks like it may be a problem with the AddOLEObject method in Excel. I'm noticing on those subsequent charts, that when the object first gets added, you see it start off at the right size, but it quickly resizes down to the default size. This all happens when the AddOLEObject method runs, which implies to me that the problem may be outside our control. I will continue investigating tomorrow, however, and let you know what else I find out.
-D
03-02-2006 09:32 AM
03-02-2006 02:24 PM
Having investigated this issue a little further, I still don't have a resolution, although I do understand it a little more. The AddOLEObject method is definitely at fault, and it starts acting squirrely after the Excel_Insert_Chart.vi runs. If I just add the OLE object into the spreadsheet without assigning any graph contents, all the objects are sized correctly. It's only after a chart has been added to the OLE object do the subsequent objects get resized improperly. Furthermore, I tried writing the size of the object again immediately after creating it, and it was resized, but to a completely wrong size (usually much bigger than the attempted size). So for now, the only workaround I have for you is to open and close the report after adding each graph. This is tedious (and it results in window flashing), but it's the only reliable workaround I have...I attached a VI to this post that illustrates what I'm talking about...the VI is saved in LabVIEW 7.0 format.
I will look further into this issue whenever we start working on the next version of the toolkit. If you wish to investigate it further yourself, check out vi.lib\addons\_office\excel.llb\Excel Insert Graph.vi. This is where the width/height of the OLE Object are defined. Also check out vi.lib\addons\_office\_exclsub.llb\Excel_Insert_Chart.vi...this is where the actual chart contents get added.
-D
07-06-2006 04:47 PM - edited 07-06-2006 04:47 PM
Message Edited by Darren on 07-06-2006 04:48 PM