LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xl Column and Row header using ActiveX

 hi,

           How can i add Column and Row header programatically to excel file. I am using activex component in labview8.2.and i don't have report generation toolkit.

 

  

0 Kudos
Message 1 of 19
(3,734 Views)

Hi Gokul,

 

usually you write row headers in an Excel sheet in column A, starting with row 2.

Column headers go into row 1, starting with column B.

The values of your table would start at cell B2.

 

Why don't you write all your data to the corresponding cells?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 19
(3,717 Views)

hi,

          i changed cell value range B2.but still now i error generate rowinput properity node.

 

 

        1).and i have data is more than one xl sheet.so i want all xl sheet column and row value.because i try add column data in value table before it will work.but second  xl sheet not show colum header. that why i am try row and columinput property methode.

Download All
0 Kudos
Message 3 of 19
(3,700 Views)

GokulGKM a écrit :

hi,

          i changed cell value range B2.but still now i error generate rowinput properity node.

 


The Range.Table method has nothing to do with adding column and row header, don't use it. As GerdW said you need to add headers the same way you added the data: add column headers to range B1:E1 and column header to range A2:A56.

 

For the column header, Excel render a 1D Array as a row range, to make it a column range you need to convert ColHdrs[] to a 2D array (using build array function) and then use Transpose 2D Array.

 

 

Ben64

0 Kudos
Message 4 of 19
(3,683 Views)

When I got started in LabVIEW (LabVIEW 7.0), we used the MS Office Toolkit to read/write Excel.  I eventually learned enough ActiveX to be able to do things a little more flexibly, but it was really a struggle, not made any easier when I migrated from Windows XP to Windows 7, from Office 2007 to Office 2010, and when Microsoft started dropping support for ActiveX.

 

Fortunately (for me), LabVIEW came out with the Report Generation Toolkit, with the new Object model for Reports, and suddenly not only did it become much easier to interact with Excel, it became about an order of magnitude faster.  In our original code, we had all sorts of elaborate schemes to "pre-read" the next row of an Excel Worksheet to save the second or so it would have taken had we wanted to read/parse the data "when we needed it" (we were controlling a behavioral Experiment, with each Row corresponding to the set of stimuli to be presented during the Trial represented by the row).  In developing "Version 2" of this ancient code, I used the RGT and found that I could read and parse a row in about 40 msec (there were quite a few columns, I'm guessing 70-100).

 

There's been a lot of progress made in LabVIEW code since LabVIEW 8.2.  There's also been some improvement to operating systems (we're now up to Windows 10 ...).  Depending on how serious and important the project that you are developing, an upgrade to a more modern system may have significant payoffs.

 

Bob Schor

0 Kudos
Message 5 of 19
(3,652 Views)

I started using LabVIEW at version 5 and version 8 was by far the version that crashed the most. An upgrate to the latest version will definitly be a plus, you will even have the benefit of getting the Report Generation Toolkit.

 

Ben64

0 Kudos
Message 6 of 19
(3,641 Views)

hi,

      yes thanks..but i don't have report generration toolkit..this my old project.so i need wthout RGT how to use column header in Xl.i used what you say it work but my data go more than 1 Xl sheet the second xl sheet can not show column header in second sheet.

0 Kudos
Message 7 of 19
(3,610 Views)

You  have to write the header in each worksheet you can't write it once for  all worksheet.

 

Ben64 

 

0 Kudos
Message 8 of 19
(3,590 Views)

yes correct how can i know about how many worksheet programatically based on my data...

0 Kudos
Message 9 of 19
(3,561 Views)

@GokulGKM wrote:

yes correct how can i know about how many worksheet programatically based on my data...


We have no idea how your data is acquired and of the size of your data. xlsx worksheet have a maximum of 1 000 000 rows. Is your data bigger than that?

You can always split your data array.

 

Ben64

0 Kudos
Message 10 of 19
(3,547 Views)