Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Overcoming an Error Message Q

I have a piece of code that extracts information from an access
database, everthing works well and I use this common file across
various locations. My problem is that a "cannot connect to database"
dialog box appears for a certain location. I know why this is, becase
it doesn't have the relevant access database. Thats okay, I don't need
it, but how could I 'ignore' this error when this error appears and
continue to run the remaining piece of code?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Overcoming an Error Message Q

you could try Application.DisplayAlerts = False at the beginning of your
code, and Application.DisplayAlerts = True at the end.

"Sean" wrote:

I have a piece of code that extracts information from an access
database, everthing works well and I use this common file across
various locations. My problem is that a "cannot connect to database"
dialog box appears for a certain location. I know why this is, becase
it doesn't have the relevant access database. Thats okay, I don't need
it, but how could I 'ignore' this error when this error appears and
continue to run the remaining piece of code?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 454
Default Overcoming an Error Message Q

Nah, doesn't work

The specific message is "ODBC Microsoft Access Driver Login Failed",
it gives an OK/Cancel option and I have to keep clicking Cancel to
move forward

Was hoping that if any error dialog message appeared just ignore and
continue 'actioning' code

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Overcoming an Error Message Q

Hi,

Can you not add:

On Error Resume Next

on the line before the line where the error appears and then:

On Error Goto 0

(or to wherever your errors were going before) on the line after?

If this works then a better solution would be to test the error value so
that you only ignore the error if it is for this specific reason, then if any
other error occurs an error message will still appear.

Hope this helps,

Sean.
--
(please remember to click yes if replies you receive are helpful to you)


"Sean" wrote:

I have a piece of code that extracts information from an access
database, everthing works well and I use this common file across
various locations. My problem is that a "cannot connect to database"
dialog box appears for a certain location. I know why this is, becase
it doesn't have the relevant access database. Thats okay, I don't need
it, but how could I 'ignore' this error when this error appears and
continue to run the remaining piece of code?

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overcoming the restriction of 7 nested IFs in Excel XP. Is it possible? pcw Excel Worksheet Functions 10 February 17th 07 10:30 PM
Overcoming Nested IF limits LIUPharm Excel Discussion (Misc queries) 2 December 11th 06 04:00 PM
replace VBA run-time error message with custom message BEEJAY Excel Programming 13 July 14th 06 03:59 PM
overcoming nested IF limitations...with VBA? JLC Excel Worksheet Functions 3 November 7th 05 11:06 AM
overcoming zero values in line graph marika1981 Charts and Charting in Excel 3 March 11th 05 02:09 AM


All times are GMT +1. The time now is 01:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"