Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8807685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:25:43+00:00 2026-06-14T02:25:43+00:00

I am building a macro to extract data from website using vba . Currently

  • 0

I am building a macro to extract data from website using vba. Currently I can easily get value from table content using element syntax like obj.getElementsByTagName("td").innerText. However, when there are some non-innerText data in some cells, I am getting trouble. It’s like this:

<img src="/images/amber_pending.gif" border="0" alt="Pending" title="Pending">

I attempted to extract the attribute value from “title” using syntax I found from others:

For Each tbObj In doc.getElementsByClassName("report removeTdBorder")
    i = 1
    For Each trObj In tbObj.getElementsByTagName("tr")
        If i >= 3 Then
            j = 1
            For Each tdObj In trObj.getElementsByTagName("td")
                If j = 1 Then
                    Set imgObj = tdObj.getElementsByTagName("img")
                    dataArray(i, j) = imgObj.getAttribute("title")
                    Debug.Print imgObj.getAttribute("title")
                    ActiveCell.Offset(0, j) = dataArray(i, j)
                    ActiveCell.Offset(0, j).WrapText = False
                Else
                    dataArray(i, j) = tdObj.innerText
                    Debug.Print i & ", " & j & ": " & dataArray(i, j)
                    ActiveCell.Offset(0, j) = dataArray(i, j)
                    ActiveCell.Offset(0, j).WrapText = False
                End If
                j = j + 1
            Next tdObj
            ActiveCell.Offset(1, 0).Activate
        End If
        i = i + 1
    Next trObj
Next tbObj

But this code goes error every time and it said “Run-time error ‘438’: Object doesn’t support this property or method” at the line dataArray(i, j) = imgObj.getAttribute("title"). Could some one help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:25:45+00:00Added an answer on June 14, 2026 at 2:25 am
    Set imgObj = tdObj.getElementsByTagName("img")
    

    returns a collection of images (even if there’s only one to be found), so you can address a specific image using (eg):

    dataArray(i, j) = imgObj(0).getAttribute("title")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a macro to export data from a custom outlook form to
I am extending my macro building efforts to organize and shift data retrieved from
I'm building a macro to split a long table into multiple smalls tables, and
The macro I am building takes names from an Excel spreadsheet, opens Internet Explorer,
Cody has been building a Pythonic Macro Syntax. He says These macros allow you
I am trying to write a macro for Building my application, kicking off an
Building a new Mobile Web Platform for Mobile Users to purchase & download content
building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
When building my application with kdevelop 3.5 on Ubuntu 10.04, I get the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.