This is a migrated thread and some comments may be shown as answers.

How to lock a cell in an Excel export?

8 Answers 689 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 27 Sep 2012, 01:03 PM
I am exporting a report in Excel format and I was curious if there is a way to lock a particular column in the spreadsheet so that it is not editable.

8 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 27 Sep 2012, 03:16 PM
Hello,

There is no support for such functionality in the Excel rendering extension.

Regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
Izak Joubert
Top achievements
Rank 1
answered on 17 Apr 2013, 08:39 PM
Hello,

I am using Reporting Q1 2013. I have the same requirement as the original poster.
I need to lock certain columns during Excel Export.
Is it possible?

Thanks You.
0
IvanY
Telerik team
answered on 22 Apr 2013, 02:22 PM
Hi Tyler,

As stated in the previous post this functionality is not supported since it is specific to Excel. Perhaps you can write a macro or use another library to further process your exported reports.

Kind regards,
IvanY
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Gary
Top achievements
Rank 1
answered on 07 May 2013, 02:36 PM
Private Sub lockColumn()
    ActiveWorkbook.ActiveSheet.Cells.Locked = False
    ActiveWorkbook.ActiveSheet.Columns(2).Locked = True
    ActiveWorkbook.ActiveSheet.Protect
End Sub
This is a simple macro to lock a column.

First you need to remove the locked status from the worksheet cells (it's on by default)

Then set it back on for the columns you want locked.

Then enable protection.
0
Pinaki
Top achievements
Rank 1
answered on 07 Sep 2017, 01:09 PM
I am using Angular JS to create my UI and want to export the grid into excel with selected columns locked. Can this be done? 
0
Katia
Telerik team
answered on 12 Sep 2017, 08:35 AM
Hi Pinaki,

Reports are exported to Excel formats according to Design Considerations for Excel Rendering. Locking of the columns is not supported. 
Freezing of cells is possible only if they are in the Page sections - check Page Headers and Footers section in the linked article.


Regards,
Katia
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Shubham
Top achievements
Rank 1
answered on 30 Aug 2019, 10:28 AM

I am also have a same requirement. I want to lock specific columns before exporting the excel so that user can not modify them after exporting. 

Please help me if there is any other way to achieve this. 

Note- I am using angular and typescript for development. Any solution supporting this two will be helpful

0
Todor
Telerik team
answered on 04 Sep 2019, 06:50 AM

Hi Shubham,

You may use a third-party tool or macro to lock the required cells after the report has been exported to Excel. We do not support locking cells outside the Page sections of the report.

Regards,
Todor
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Tyler
Top achievements
Rank 1
Answers by
Steve
Telerik team
Izak Joubert
Top achievements
Rank 1
IvanY
Telerik team
Gary
Top achievements
Rank 1
Pinaki
Top achievements
Rank 1
Katia
Telerik team
Shubham
Top achievements
Rank 1
Todor
Telerik team
Share this question
or