VBS Script remove read only and add read only
<p>I am completely new to VBS script.</p>

<p>I have managed to open my excel sheet and write "New data" and save it again.
This code:</p>

<pre><code>Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Users\g46973\Desktop\test.xlsx")
set xlSht = objExcel.activesheet


objExcel.DisplayAlerts = False
xlSht.Cells(2, 2) = "New Data"

objWorkbook.Save
 objWorkBook.Close SaveChanges=True

 ObjExcel.Quit
</code></pre>

<p>The problem is my excel workbook is Read-only (I want it to stay that way). Then i run my code I want to remove read only from my excel workbook. Run the code above, and then again add Read-only.</p>