sort protected spreadsheet?

T

texlnghorn

I am using OWC11 with C#. I have protected areas of the spreadsheet and
unlocked other areas that can be edited. However, I cannot sort the
spreadsheet. Whenever I choose the sort buttons, I receive the message: "The
range you are trying to modify is locked and there-fore read only." I have
set axSpreadsheet1.ActiveSheet.Protection.AllowSorting = true but this does
not give me the ability to sort the spreadsheet. What do I need to do in
order to be able to sort the spreadsheet.

Thanks,
Mike
 
A

Alvin Bruney

The spreadsheet cannot be sorted while it is locked. You will need to catch
the sort event and inside the event handler, lift the protection, apply the
sort, and the re-apply the protection.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
T

texlnghorn

I figured thats what I would need to do. Do you know what the sort event is?
I looked through the documentation a little bit yesterday but could not find
the sort event.

Thanks,
Mike

Alvin Bruney said:
The spreadsheet cannot be sorted while it is locked. You will need to catch
the sort event and inside the event handler, lift the protection, apply the
sort, and the re-apply the protection.

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

texlnghorn said:
I am using OWC11 with C#. I have protected areas of the spreadsheet and
unlocked other areas that can be edited. However, I cannot sort the
spreadsheet. Whenever I choose the sort buttons, I receive the message:
"The
range you are trying to modify is locked and there-fore read only." I
have
set axSpreadsheet1.ActiveSheet.Protection.AllowSorting = true but this
does
not give me the ability to sort the spreadsheet. What do I need to do in
order to be able to sort the spreadsheet.

Thanks,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top