Excel Application Warinings and Errors
Hi I'm trying to treat an Excel warning through VBA. Can this be done?
Excel Application errors or warnings don't seem to raise error codes in VBA TIA Phil |
Excel Application Warinings and Errors
Most warnings can be suppressed by turning off alerts: Application.DisplayAlerts = False ' your code here Application.DisplayAlerts = True Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Sat, 6 Mar 2010 08:57:09 -0700, "PPL" wrote: Hi I'm trying to treat an Excel warning through VBA. Can this be done? Excel Application errors or warnings don't seem to raise error codes in VBA TIA Phil |
Excel Application Warinings and Errors
Hi Chip,
Thanks for that. I want to be able to trap the warning with an error/warning code If Err# = 1234 Then Do something End If Of course this approach is totally doable with VBA errors, but can I trap application warings/alerts through Event handling for example? Thanks Phil "Chip Pearson" wrote in message ... Most warnings can be suppressed by turning off alerts: Application.DisplayAlerts = False ' your code here Application.DisplayAlerts = True Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Sat, 6 Mar 2010 08:57:09 -0700, "PPL" wrote: Hi I'm trying to treat an Excel warning through VBA. Can this be done? Excel Application errors or warnings don't seem to raise error codes in VBA TIA Phil |
Excel Application Warinings and Errors
There is no way to trap error/warning messages generated by Excel. You
can turn them off with DisplayAlerts, but there is no way to deal with them programmatically. Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Sat, 6 Mar 2010 11:54:09 -0700, "PPL" wrote: Hi Chip, Thanks for that. I want to be able to trap the warning with an error/warning code If Err# = 1234 Then Do something End If Of course this approach is totally doable with VBA errors, but can I trap application warings/alerts through Event handling for example? Thanks Phil "Chip Pearson" wrote in message .. . Most warnings can be suppressed by turning off alerts: Application.DisplayAlerts = False ' your code here Application.DisplayAlerts = True Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Sat, 6 Mar 2010 08:57:09 -0700, "PPL" wrote: Hi I'm trying to treat an Excel warning through VBA. Can this be done? Excel Application errors or warnings don't seem to raise error codes in VBA TIA Phil |
All times are GMT +1. The time now is 10:24 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com