ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Turn off error dialogue (https://www.excelbanter.com/excel-programming/396412-turn-off-error-dialogue.html)

ssGuru

Turn off error dialogue
 
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 ", _
"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


Ron de Bruin

Turn off error dialogue
 
See reply in your other thread

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"ssGuru" wrote in message ups.com...
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 ", _
"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



All times are GMT +1. The time now is 09:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com