Hi!
Is there a way (option or property or s.th.) to exclusively lock an excel file when beginning to read the file via TXLSReadWriteII5.Read until it is written again?
I currently run into a problem where two program instances try to write into the same excel file. First both instances have read the file (into memory) and did some modifications
but then override each other when writing into the same file. Is there a way to lock the excel file before the first instance starts reading until it has written its modifications into the file?
best regards
Exclusive lock on excel file
Re: Exclusive lock on excel file
Hello
You have to modify the source for this. Open file XLSReadWriteII5 and go to line #827 (Stream := TFileStream.Create(FManager.Filename,fmOpenRead or fmShareDenyNone);)
Change the share options to what you want.
You have to modify the source for this. Open file XLSReadWriteII5 and go to line #827 (Stream := TFileStream.Create(FManager.Filename,fmOpenRead or fmShareDenyNone);)
Change the share options to what you want.
Lars Arvidsson, Axolot Data
Re: Exclusive lock on excel file
Hi again.
I came across this problem again. The described approach does not work because 'Stream' is a local variable that is released at the end of the function. I would need a way to lock the file from the outside, so that it is only released after the file has been written. Is that possible?
I came across this problem again. The described approach does not work because 'Stream' is a local variable that is released at the end of the function. I would need a way to lock the file from the outside, so that it is only released after the file has been written. Is that possible?