0

I am creating a macro with Excel VBA that will submit an entry into an online database using information from an Excel spreadsheet. During this entry process, the macro needs to click on a CSS button. It isn't a form button, does not have an input type, no name, no id, and no source image except for a background image. I think my only hopes are either to click on the button based on the div class. Can anyone help? The button is here :

<div class="v-captiontext">
    By Ankit
</div>
<td class="v-tabsheet-tabitemcell v-tabsheet-tabitemcell-selected" style="">
    <div class="v-         tabsheet-tabitem v-tabsheet-tabitem-selected">
        <div class="v-caption" style="width: 39px;">
            <div class="v-captiontext">
                By LOT</div>
            <div class="v-caption-clearelem">
            </div>
        </div>
    </div>
</td>
1
  • 1
    I can't see any button in your HTML. Do you mean you are trying to click on one of the DIVs? Commented Jul 20, 2012 at 7:43

1 Answer 1

-1

Thanks to Remou's answer on this thread: Use VBA code to click on a button on webpage

Here is a first stab in your issue, you could try this:

Set tags = wb.Document.GetElementsByTagname("div")

For Each tagx In tags
    If tagx.class = "v-caption-clearelem" Then
        tagx.Click
    End If
Next

Yet, I've never tried to use the Click method on a div.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.