LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

replace data in spreadsheet

Hi all,

 

 

I have to replace a data present at specific index in a spreadsheet file which already exists.

 

one way is to read the spreadsheet file replace the element and again write it to the file but the file in which i am writing 

will be having huge number of entries, so it would be difficult to go by this method,

 

anyone can suggest another method

 

regards

0 Kudos
Message 1 of 8
(3,867 Views)

Hi shrekt,

 

I think you should use ActiveX control. To access particular Cell that you want to update.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 8
(3,862 Views)

Is the spreadsheet file a binary Excel file or a tab separated text file?  If the former is the case, then you can use ActiveX.  If the latter, the complexity of the solution will depend on how regular the field width of your data is.

 

Field Width Constant

This is an easy case.  You can directly calculate the offset to the location in the file and simply overwrite it.  Make sure you overwrite with exactly the same field width.

 

 Field Width Not Constant

 Search for the row first by searching for CR/LF pairs in the file.  Once you find the row, search for field separators (probably TAB) to find the field.  Find the start and the end of the field you want to overwrite, then overwrite the whole thing, but nothing more.  You can cache line position inforrmation as you go so that subsequent searches are much faster.

0 Kudos
Message 3 of 8
(3,837 Views)

Hi,

 

Thanks for your reply,

 

I am not that comfortable in using the activex, i have not studied it yet throughly,

 

 

I will try to do it, can you suggest any examples for it?

 

Thanks,

0 Kudos
Message 4 of 8
(3,816 Views)
you can use this vi to read data from excel and then can modified it using item put property.
0 Kudos
Message 5 of 8
(3,812 Views)
One more example
Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 6 of 8
(3,791 Views)

hi

 

To write to an excel sheet, following VI can also be used.

 

Somil Gautam
Think Weird
0 Kudos
Message 7 of 8
(3,782 Views)

Hi all,

 

Thanks for your support, I am working on it

 

Regards

0 Kudos
Message 8 of 8
(3,775 Views)