I'm trying to protect a certain range of cells in a worksheet from within Access.
My code is below:
Dim objExcel As Excel.Application
Dim objWB As Excel.Workbook
Dim objWS As Worksheet
Dim intColumn As Integer
Dim intRow As Integer
Dim intRecords As Integer
Set objExcel = Excel.Application
objWS.Unprotect
objWS.Protection.AllowEditRanges.Add Title:="Classified", Range:=Range("$A$2:$D$65536"), Password:=""
objWS.Columns.AutoFit
objWS.Protect
objWB.SaveAs strFileName
I get a method or data member not found on the objws.protection line.
I am referencing the Excel 8.0 object library.
Can anyone help?? I'd really appreciate it. I'm new to the Excel object model!
Thanks!
Jeanine Scott
My code is below:
Dim objExcel As Excel.Application
Dim objWB As Excel.Workbook
Dim objWS As Worksheet
Dim intColumn As Integer
Dim intRow As Integer
Dim intRecords As Integer
Set objExcel = Excel.Application
objWS.Unprotect
objWS.Protection.AllowEditRanges.Add Title:="Classified", Range:=Range("$A$2:$D$65536"), Password:=""
objWS.Columns.AutoFit
objWS.Protect
objWB.SaveAs strFileName
I get a method or data member not found on the objws.protection line.
I am referencing the Excel 8.0 object library.
Can anyone help?? I'd really appreciate it. I'm new to the Excel object model!
Thanks!
Jeanine Scott