coupling Newbie

Joined: 23 Mar 2010 Posts: 2
|
Posted: Tue Mar 23, 2010 6:03 am Post subject: VBA Problems |
|
|
Hi,
I have a macro, to protect cells when i save the file.
This macro works on excel properly, but in Calc it makes problem.
When i save the file it doesnt save, but when i run macro manualy it works.
Here its my code...
What could be the problem...?
Thanks...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error Resume Next
ThisComponent.CurrentController.ActiveSheet.Unprotect "123"
Cells.Locked = False
Cells.SpecialCells(xlCellTypeConstants, 123).Locked = True
ThisComponent.CurrentController.ActiveSheet.Protect "123"
End Sub |
|