Is there a way to lock cells after editing an excel sheet that s on sharepoint

0 votes

Is it possible to lock cells in an Excel sheet on Sharepoint once a user enters data? On Excel, I can lock the cells, but not on Sharepoint. Basically, when you enter data into the Excel app, it doesn't lock cells the way it does on Sharepoint.

Is there work for this? I've already tried the VBA code:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range
    On Error Resume Next
    Set xRg = Intersect(Range("A1:G800"), Target)
    If xRg Is Nothing Then Exit Sub
    Target.Worksheet.Unprotect Password:="saag"
    xRg.Locked = True
    Target.Worksheet.Protect Password:="saag"
End Sub

It doesn't work the same way as you'd expect when someone inputs data on share point.

enter image description here

Oct 3 in Others by Kithuzzz
• 20,660 points
92 views

1 answer to this question.

0 votes
The Excel Web version (which, based on the screenshot, it appears you're using), does not support VBA. If the user accesses the file in their local Excel application, you might be able to make it work depending on the security settings, but it looks destined to be troublesome.

Instead of using the OnEdit event, you might set up a PowerApp script that would work somewhat similarly. Instead of VBA, you would have to use TypeScript. This video is a decent place to start while transitioning. You can activate TypeScript Recorder, record a few operations, and then utilise the Microsoft documentation to observe how various objects, such as range, interact with one another and their properties (value, locked, etc).
answered Oct 3 by narikkadan
• 37,660 points

Related Questions In Others

0 votes
1 answer

Is there a way to hide excel formula using Apache POI

In Excel, hiding formulae is a feature ...READ MORE

answered Oct 11 in Others by narikkadan
• 37,660 points
95 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Is there a way to search the iOS app store online?

Apple finally made it possible to just use ...READ MORE

answered Sep 21 in Others by rajatha
• 7,480 points
168 views
0 votes
1 answer

Retrieve epay.info Balance with VBA and Excel

This code should log you in, provided ...READ MORE

answered Sep 5, 2018 in Blockchain by digger
• 26,720 points
454 views
0 votes
1 answer

How to load file to Excel Power query from SFTP site

Currently, I don't think there is a ...READ MORE

answered Dec 3, 2018 in Power BI by Upasana
• 8,620 points
2,228 views
0 votes
1 answer

Using VBA Excel to create a gramatically correct list

The Excel AND function is a logical ...READ MORE

answered Feb 9 in Others by gaurav
• 22,040 points
71 views
0 votes
2 answers

How to copy a formula horizontally within a table using Excel VBA?

Hi so basically, create an adjacent column ...READ MORE

answered Feb 16 in Others by Edureka
• 13,640 points
210 views
0 votes
1 answer
0 votes
1 answer

Is there a way in Microsoft Excel to give specific bins different bin widths when making a histogram plot?

Excel built-in histogram tool only allows equal ...READ MORE

answered Oct 2 in Others by narikkadan
• 37,660 points
69 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP