10-05-2009 02:48 AM
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
10-05-2009 03:05 AM
Hi shrekt,
I think you should use ActiveX control. To access particular Cell that you want to update.
10-05-2009 09:17 AM
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.
10-05-2009 11:46 PM
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,
10-06-2009 12:29 AM
10-06-2009 10:55 PM
10-07-2009 01:59 AM
hi
To write to an excel sheet, following VI can also be used.
10-07-2009 02:41 AM
Hi all,
Thanks for your support, I am working on it
Regards