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: 6
Default Macro Ran in Excel 97 but in XP. What Needs Changing

Hello,
I have inherited a macro that ran fine with Excel 97 & Excel 2000 but
does not run with Excel XP.
I get the following error message when I run the macro now.

Application-defined or object-defined error Run-time error ‘1004'

The error seems to be in .BackgroundQuery = True see section
of code below. How do I need to change this so it run in Excel XP?

Thanks
JBEsr


Range("C7").CurrentRegion.ClearContents
i = 7
qurl = "http://finance.yahoo.com/d/quotes.csv?s=" + Cells(i, 1)
i = i + 1
While Cells(i, 1) < ""
qurl = qurl + "+" + Cells(i, 1)
i = i + 1
Wend
qurl = qurl + "&f=" + Range("C2")
Range("c1") = qurl
QueryQuote:
With ActiveSheet.QueryTables.Add(Connection:="URL;" &
qurl, Destination:=Sheets("yahoo").Range("C7")) 'JBE

.BackgroundQuery = True <<<Error Here

.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
 
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
Help with Dynamically changing Range in Excel Macro runsrealfast Excel Discussion (Misc queries) 4 July 16th 07 10:44 PM
How do I set up a formula with a changing range in an excel macro cinvic Excel Discussion (Misc queries) 2 April 4th 06 10:39 PM
Help with changing a Macro Mike Rogers Excel Discussion (Misc queries) 1 March 26th 06 11:51 PM
Help with changing a Macro Mike Rogers Excel Discussion (Misc queries) 0 March 26th 06 11:43 PM
Unable to run excel macro after changing file name merf New Users to Excel 2 June 14th 05 03:16 PM


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