Turn off error dialogue

S

ssGuru

I have an Excel ERROR dialogue box that says:
"Excel cannot complete this task with available resources. Choose less
data or close other applications" OK

The code actually finishes and accomplishes its goal though this error
is fired by the code line .SaveAs and by the .SendMail statements.

I have the "On ErrorResume Next and a clear routing but the ERROR
dialogue box still pops up and user has to click OK twice for the code
to finish. All code actions are done so the ERROR seems false.

Here is the code snippet.
With Destwb
'DD Turn Errors off
On Error Resume Next
.SaveAs TempFilePath & TempFileName & FileExtStr,
FileFormat:=FileFormatNum
.SendMail "(e-mail address removed)", _
"This is the Subject line"
'DD added ERROR block/clear
If Err.Number <> 0 Then
Err.Clear
End If
'DD reactivate ERRORS
On Error GoTo 0
'On Error Resume Next
.Close SaveChanges:=False
End With

Thanks for the help,
Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top