Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro works in Excel 2k but not in Excel xp

I have a macro that works well in Excel 2k but not in Excel xp. The macro
use QueryTables to read a web page from a local stock exchange web site.
Here is the related part of it:

conn1 = "URL;http://www.hkex.com.hk/tradinfo/stockcode/eisdwarr.htm"
Get_page (conn1)

Sub Get_page(conn)
With ActiveSheet.QueryTables.Add(Connection:=conn,
Destination:=ActiveCell)
.Name = "HKEX stock lots"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebTables = 5
.WebFormatting = xlNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh
.BackgroundQuery = False
End With
End Sub

When running in Excel 2k it works. When running in Excel xp, it is not able
to parse the html into rows and columns. I've examine the page and found
that there is an <?xml version="1.0"? tag at the beginning of the page,
before <html. I stored the page in local disk, remove the xml tag and
change the macro to read the local file, then it works. Obviously, I cannot
change the web site. Is there a way to make my macro ignore the xml tag? Any
parm in the QueryTables that can do this. I've read the Excel help but
couldn't find any. Please help.



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
SUMIF formula works in Excel 2003, does not work in Excel 2007 Harry Excel Discussion (Misc queries) 3 April 24th 09 02:33 PM
Macro do works in excel... driller Excel Worksheet Functions 7 July 12th 07 02:56 PM
Excel macro works only for administrator Free Agent99 Excel Discussion (Misc queries) 12 May 15th 06 09:25 PM
How do I convert works file to excel without works software? CatMB Excel Discussion (Misc queries) 1 June 21st 05 04:12 PM
Macro no longer works now that in Excel XP C.B.[_2_] Excel Programming 0 December 14th 03 09:49 PM


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