Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
T. Erkson
 
Posts: n/a
Default Capturing query table errors

How do I intercept query table errors, bypassing the Excel ones?

Here's an example of what I'm trying to do using examples from the Help
files:
Sub Macro2()
Workbooks(1).Activate
Application.DisplayAlerts = False ' This doesn't make a difference for my
purposes
On Error GoTo ErrorHandler
Selection.QueryTable.Refresh BackgroundQuery:=False
GoTo Exit_Sub

ErrorHandler:
Msg = "Error # " & Str(Err.Number) & " was generated by " & Err.Source &
Chr(13) & Err.Description
MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext

Exit_Sub:
On Error Resume Next
Application.DisplayAlerts = True
End Sub

For testing I've moved the database to a different folder so the first error
window is "Please Enter MS JET OLE DB Initialization Information", then my
example message box. I want to COMPLETELY bypass the Windows error window
and just use mine.

Suggestions?


  #2   Report Post  
T. Erkson
 
Posts: n/a
Default

Oops, wrong location. Please refer to the same question in the
microsoft.public.excel.programming newsgroup. Sorry about that!


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
Pivot table refresh Excel GuRu Excel Worksheet Functions 2 February 23rd 05 01:47 AM
Removing errors from a Pivot table Mighty Magpie Excel Discussion (Misc queries) 2 February 3rd 05 03:15 PM
Using Microsoft Query data in a pivot table. slapana Charts and Charting in Excel 0 January 11th 05 05:03 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM
How do I get a web query to auto-refresh before a pivot table aut. Conniemm Excel Discussion (Misc queries) 0 December 8th 04 06:49 PM


All times are GMT +1. The time now is 05:22 PM.

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

About Us

"It's about Microsoft Excel"