| Programming C# C++ (7) Delphi (618) .NET (2) Database (71) Delphi IDE (90) Network (39) Printing (3) Strings (12) VCL (83) Windows with Delphi (280) Java (8) JavaScript (29) perl (9) php (4) VBScript (1) Visual Basic (1) |
Using Formula One ActiveX control - my Excel sheet forgets locked cells (protection)
Question: I am using Formula One ActiveX control in Delphi 5. My application generates a complex workbook and locks certain cells. When I export my Excel workbook, the locked cells are forgotten. Protection is enabled, but all cells are unlocked.Answer: I had the same problem and found that the property EnableProtection does not work as expected.The documentation says: EnableProtection sets or returns whether protection is enabled for all selected sheets. Syntax F1Book1.EnableProtection [ = boolean ] What I found is that the number of places where you temporarily disable the protection must match exactly the number of places where you enable it. The code below will not work if the code executes updateformulas(), as in that case it assigns twice := false and only once := true
Comments:
|