OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

VBA Problems

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
coupling
Newbie
Newbie


Joined: 23 Mar 2010
Posts: 2

PostPosted: Tue Mar 23, 2010 6:03 am    Post subject: VBA Problems Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group