LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Error Trapping when getting external Data

I am using the following statement to get external OBDC data for refreshing
an Excel 2003 pivot table:

Sheets("Source PivotTable").PivotTableWizard SourceType:=xlExternal,
SourceData:=Array( _
"SELECT *" & Chr(13) & "" & Chr(10) & "FROM Data Data" & Chr(13) &
"" & Chr(10) & "WHERE" _
, _
mySQLWhere1 _
, _
mySQLWhere2 & Chr(13) & "" & Chr(10) & "ORDER BY " _
, _
"Data.Material, Data.`Serial No`, Data.`Receive Date` DESC"), _
Connection:=Array(Array("ODBC;DSN=MS Access Database;DBQ=" & myPath
& myFileName & ";"), _
Array("DefaultDir=" & myPath & ";DriverId=25;FIL=MS
Access;MaxBufferSize=2048;"), _
Array("PageTimeout=5;"))

I need code to trap the VBA Error 1004 message I get when no data is found.
Does anyone have any suggestions?

Thanks
Will
 
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
Trapping #VALUE! error RhysPieces Excel Discussion (Misc queries) 6 August 22nd 07 03:13 AM
Error Trapping from WSH Tom Chau Excel Discussion (Misc queries) 1 August 25th 06 04:21 AM
error trapping [email protected] Excel Programming 2 April 5th 05 12:52 AM
Error Trapping Adrian Excel Programming 0 January 31st 05 06:16 PM
Error Trapping Neil Excel Programming 1 January 5th 04 04:38 PM


All times are GMT +1. The time now is 10:01 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"