Problem

N

Nuno Fonseca

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

Orlando Magalhães Filho

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top