I have a block of code that I have used in many other places that works just fine. However in one spot it keeps failing. When I click on the Help button the microsoft Help just comes up blank. It wont tell me anything. Can anyone spot the problem?
Excel 2003
Run-time error '1004':
Method 'Range' of object '_Worksheet' failed
-JTBorton
Another Day, Another Disaster
Excel 2003
Run-time error '1004':
Method 'Range' of object '_Worksheet' failed
Code:
Dim wkSht as Excel.Worksheet, xlRng as Excel.Range, ActionList as ActionItemList, wkSource as Excel.Worksheet
Dim strTitle as String
Const shtAILManage as string = "AIL Manager"
Set wkSource = Worksheets(strTitle)
Set ActionList = New ActionItemList
Set wkSht = Worksheets(shtAILManager)
'Clear Previous Contents
If wkSht Is Nothing Then
Err.Raise 91 'Object not set
End If
[highlight]wkSht.Range(Rows(5), Rows(500)).Hidden = False[/highlight]
With wkSht
Set xlRng = .Range(Rows(5), Rows(500))
xlRng.Delete
Set xlRng = Nothing
End With
-JTBorton
Another Day, Another Disaster