Ok I have to try and fix the run-time error '1004' The VB code worked fine in excel 2003. Now it no longer works in Excel 2007. I suspect the issue is using With ActiveSheet.
Here is a snippet of the code:
--------------------------- START of snippet -----------------------
Dim found_freq_type As Boolean
Static saved_freq_type As String
found_freq_type = False 'Used to clear out frequency table
With ActiveSheet
.Unprotect password:="TCMS"
If FreqType_SZ.value = "Domestic Non-splinter" Then
.Range("start_band_info:end_band_info").EntireRow.Hidden = True
.Range("FreqTypeSZ_num").value = 1
SZ_Freq_NoN_OBT
found_freq_type = True
--------------------------- END of snippet -----------------------
If I try and debug the error it ends up on the line:
.Range("start_band_info:end_band_info").EntireRow.Hidden = True
I know that if I use a debugger watch window and try and see the value of:
.Range("start_band_info") I do not find an object.
IF I use watch window of
Range("start_band_info") I can see the value.
But the .Range is used throughout the code, editing all of them would be a pain.
I suspect the reason I can not use .Range is there is no object (sheet or workbook) to attach the .Range to.
Here is a snippet of the code:
--------------------------- START of snippet -----------------------
Dim found_freq_type As Boolean
Static saved_freq_type As String
found_freq_type = False 'Used to clear out frequency table
With ActiveSheet
.Unprotect password:="TCMS"
If FreqType_SZ.value = "Domestic Non-splinter" Then
.Range("start_band_info:end_band_info").EntireRow.Hidden = True
.Range("FreqTypeSZ_num").value = 1
SZ_Freq_NoN_OBT
found_freq_type = True
--------------------------- END of snippet -----------------------
If I try and debug the error it ends up on the line:
.Range("start_band_info:end_band_info").EntireRow.Hidden = True
I know that if I use a debugger watch window and try and see the value of:
.Range("start_band_info") I do not find an object.
IF I use watch window of
Range("start_band_info") I can see the value.
But the .Range is used throughout the code, editing all of them would be a pain.
I suspect the reason I can not use .Range is there is no object (sheet or workbook) to attach the .Range to.