L
Les Stout
Hi, i have the code below that i have a problem with.
When i run it manually it works fine but always stops with "Code
execution has been interrupted" after loading the required file... Ther
are no breakpoints and it worked fine before ??
Sub testfileExists()
'
'
'Application.IgnoreRemoteRequests = True
If Dir("C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls") = "" Then
MsgBox "Sorry the file ""Weekly_Report.xls"" is not in the folder !!"
& vbCrLf & _
"" & vbCrLf & _
"Please generate a new report and save it to:-" & vbCrLf & _
"""C:\gAMS_ZA-T-M\Reports\Downloads\"" as
""Weekly_Report.xls""" & vbCrLf & _
"Then re-open this macro.", vbOKOnly + vbInformation, "Oops no
file !!"
Else
If (Now() -
filedatetime("C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls")) > 7
Then
MsgBox "The file you are going to process" & vbCrLf & _
"was created longer than 7 days ago !!" & vbCrLf & _
"& cannot be used ?", vbExclamation + vbOKOnly, "Warning
Old File"
chkWkbToClose
Else
ChDir "C:\gAMS_ZA-T-M\Reports\Downloads"
Workbooks.Open
Filename:="C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls"
RemoveRows'******** AT THIS POINT - ERROR *******
End If
End If
End Sub
'************ Format the header row *****************
Sub RemoveRows()
Les Stout
When i run it manually it works fine but always stops with "Code
execution has been interrupted" after loading the required file... Ther
are no breakpoints and it worked fine before ??
Sub testfileExists()
'
'
'Application.IgnoreRemoteRequests = True
If Dir("C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls") = "" Then
MsgBox "Sorry the file ""Weekly_Report.xls"" is not in the folder !!"
& vbCrLf & _
"" & vbCrLf & _
"Please generate a new report and save it to:-" & vbCrLf & _
"""C:\gAMS_ZA-T-M\Reports\Downloads\"" as
""Weekly_Report.xls""" & vbCrLf & _
"Then re-open this macro.", vbOKOnly + vbInformation, "Oops no
file !!"
Else
If (Now() -
filedatetime("C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls")) > 7
Then
MsgBox "The file you are going to process" & vbCrLf & _
"was created longer than 7 days ago !!" & vbCrLf & _
"& cannot be used ?", vbExclamation + vbOKOnly, "Warning
Old File"
chkWkbToClose
Else
ChDir "C:\gAMS_ZA-T-M\Reports\Downloads"
Workbooks.Open
Filename:="C:\gAMS_ZA-T-M\Reports\Downloads\Weekly_Report.xls"
RemoveRows'******** AT THIS POINT - ERROR *******
End If
End If
End Sub
'************ Format the header row *****************
Sub RemoveRows()
Les Stout