dwilson38550m
Board Regular
- Joined
- Nov 21, 2005
- Messages
- 89
Hi,
I wonder if someone can help me with an error handler. I need to have an error handler which when the operation fails, points to cell O1 of tab called "Data Sheet" and saves the file to the location on cell O1 (eg C:\Testfile\Example.xls). Here is what I have so far - can anyone suggest anything? Thanks in advance.
I wonder if someone can help me with an error handler. I need to have an error handler which when the operation fails, points to cell O1 of tab called "Data Sheet" and saves the file to the location on cell O1 (eg C:\Testfile\Example.xls). Here is what I have so far - can anyone suggest anything? Thanks in advance.
VBA Code:
Sheets("Data Sheet").Select
Range("O1").Select
future5 = ActiveCell
continue: ActiveWindow.ActivateNext
Application.DisplayAlerts = False
Rem ActiveWorkbook.Close SaveChanges:=FALSE
ActiveWorkbook.SaveAs Filename:=future5, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Close SaveChanges:=False
Sheets("data sheet").Select
Range("A1").Select
Errorhandler:
If Err.Number = 91 Then
Err.Clear
GoTo continue
End If
If Err.Number = 1004 Then
End If
'
Range("A6").Select
End Sub