G
Guest
Here is the code that generates the error. The error message occurs at the
line using specialcells.
NewFN = "C:\worksheet 3-29.xls"
Set xlapp = CreateObject("Excel.Application")
xlapp.Workbooks.Open Filename:=NewFN
xlapp.ActiveWorkbook.Sheets(1).Select
Set Wb = xlapp.ActiveWorkbook
xlapp.Worksheets("Sheet1").Range("$a$1").Activate
xlapp.ActiveSheet.Unprotect
xlapp.ActiveCell.SpecialCells(xlLastCell).Select
MsgBox xlapp.ActiveCell.Row
xlapp.ActiveSheet.Unprotect
Thanks for your help
line using specialcells.
NewFN = "C:\worksheet 3-29.xls"
Set xlapp = CreateObject("Excel.Application")
xlapp.Workbooks.Open Filename:=NewFN
xlapp.ActiveWorkbook.Sheets(1).Select
Set Wb = xlapp.ActiveWorkbook
xlapp.Worksheets("Sheet1").Range("$a$1").Activate
xlapp.ActiveSheet.Unprotect
xlapp.ActiveCell.SpecialCells(xlLastCell).Select
MsgBox xlapp.ActiveCell.Row
xlapp.ActiveSheet.Unprotect
Thanks for your help