Problem

  • Thread starter Thread starter Nuno Fonseca
  • Start date Start date
N

Nuno Fonseca

I'm creating a excel from ASP, is it possible to lock cells from the ASP?
Thanks in advance Nuno Fonseca
 
Hi Nuno Fonseca,

I don't know if I understood your question, but save the code below on asp
file. It creates an Excel workbook, unlock A1 cell, let all other cells
locked and protect the active sheet.

<SCRIPT LANGUAGE = "VBScript" %>

<%Sub CreateExcelAndLockCell()
Dim objXL

Set objXL = CreateObject("Excel.Application")
objXL.Workbooks.Add
objXL.Visible = True
With objXL.ActiveSheet.Range("A1")
.Locked = False
.FormulaHidden = False
End With
objXL.ActiveSheet.Protect "Pass"
End Sub%>

<%Call CreateExcelAndLockCell()%>




HTH
 
Back
Top