Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Checking Web Queries

Hi,

I have a macro that grabs info as a query from the internet:


ThisWorkbook.Sheets("Data").QueryTables("ReportDat a_1").Refresh
BackgroundQuery:=False

MsgBox ("Data Successfully Loaded !")

Is there a way to only show the MsgBox if it is successful?

Regards,


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Checking Web Queries

Perhaps try On Error Exit Sub.
If the query errors out then it would exit without running the msg line.
Worth a try, I haven't tested it.

Mike F
"MM User" wrote in message
...
Hi,

I have a macro that grabs info as a query from the internet:


ThisWorkbook.Sheets("Data").QueryTables("ReportDat a_1").Refresh
BackgroundQuery:=False

MsgBox ("Data Successfully Loaded !")

Is there a way to only show the MsgBox if it is successful?

Regards,




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Checking Web Queries

Thanks Mike,

not sure why I did not think about this myself! thanks for the heads up.


"Mike Fogleman" wrote in message
. ..
Perhaps try On Error Exit Sub.
If the query errors out then it would exit without running the msg line.
Worth a try, I haven't tested it.

Mike F
"MM User" wrote in message
...
Hi,

I have a macro that grabs info as a query from the internet:


ThisWorkbook.Sheets("Data").QueryTables("ReportDat a_1").Refresh
BackgroundQuery:=False

MsgBox ("Data Successfully Loaded !")

Is there a way to only show the MsgBox if it is successful?

Regards,





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
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Checking range of cells for entry then checking for total Barb Reinhardt Excel Programming 1 October 13th 06 02:47 PM
Web Queries Louise Excel Worksheet Functions 1 October 24th 05 04:03 PM
Web Queries Alistair[Data#3] Excel Discussion (Misc queries) 0 May 20th 05 12:39 AM
SQL Queries in VBA javydreamercsw[_3_] Excel Programming 1 February 19th 04 09:48 PM


All times are GMT +1. The time now is 09:40 AM.

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"