Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
External data from web page
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
senderj  
View profile   Translate to Translated (View Original)
(1 user)  More options 11 Jan, 05:55
Newsgroups: microsoft.public.excel.querydao
From: "senderj" <send...@hotmail.com>
Date: Sun, 11 Jan 2009 13:55:54 +0800
Local: Sun 11 Jan 2009 05:55
Subject: External data from web page
I am trying to import a table of a web page to a spreadsheet. It works well
in Excel 2000. I even have a macro for the import. But after moving to Excel
xp, the macro does not work anymore. Here is the coding of my macro:

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 = False
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = False
        .SaveData = True
        .AdjustColumnWidth = False
        .RefreshPeriod = 0
'        .QueryType = xlWebQuery
        .WebSelectionType = xlSpecifiedTables
        .WebTables = "4"
        .WebFormatting = xlNone
        .Refresh
    End With
End Sub

I called Get_page with
Get_page("URL;http://www.hkex.com.hk/tradinfo/stockcode/eisdgemw.htm"). But
it failed to import the table I want. Instead, it insert the whole page into
ActiveCell. I commented the ".QueryType=xlWebQuery" because it failed with
invalid argument or parameter.

I tried to import by handle instead of the macro. I use Date - Import
External Data - New Web Query - put the url in Address - Go - the page
displayed - I select the table I want - Import. - OK. But it failed with
"File cannot be opened because Reference to undefined entity 'nbsp' Line 14,
Position 568". The table does have some   text in some of its cells
which is standard HTML.

Same web page does not have any problem in Excel 2000. Can anybody help?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google