I created a following CSV file in VB script.
Set CSVFile = FS.OpenTextFile(Server.MapPath(FilePath),2,True)
CSVFile.WriteLine "Name, English, Math"
CSVFile.WriteLine "Aung Aung, 100, 90"
CSVFile.WriteLine "Ko Ko, 80, 60"
Name English Math
Aung Aung 100 90
Ko Ko 80 60
In this case, I want to lock the some cell (Name, English, Math, Aung Aung, Ko Ko). Other cells should still be editable. How can I do this?
As far as I’m aware you can’t lock cells in a CSV file. Cell locking is a meta-data option only available in a spreadsheet (such as Excel). If you’re using VBScript there are script options for manipulating Excel spreadsheets instead.
If, on the other hand, you’re talking about continuing to use this script to read user input and writing it out to the CSV file, then you can simply refuse to update certain column positions if you want them locked.