Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 24th, 2005, 12:38 PM
Authorized User
 
Join Date: Dec 2004
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default Reference a Cell in a Webtable.

I'm trying to active the onclick event attached to a cell on a webtable, but I can't figure out how to do it. I can see the object with a watch expression, but I still don't know how to code it.

.Document.getElementByID("DealInfoCollateralCharac teristics_tb").all.item(1).all.item(1).all.item(1) .onclick is the tree from the watch, but I can't find any identifiers between the table reference and the final Element. Here's the HTML code if it helps.

Code:
<tbody id="DealInfoCollateralCharacteristics_tb"><tr class="Row">
<td><IMG src="/images/button/H.gif" alt="History" onclick="window.event.cancelBubble = true;PopUpWin('HistoryHDL ! Table','KeyValueArgs', 'HISTORY_REPORT=Deal Info ! Collateral Characteristics~HISTORY_CODE=0~HISTORY_DEAL=AMCA0005')"></td>
<td align="right"></td>
<td nowrap>$26,695,012,323.37</td>
<td nowrap>24.590800</td>
<td nowrap>20.211000</td>
<td nowrap>4.77120018005371</td>
<td nowrap>9.976200</td>
<td nowrap>10.861267</td>
<td align="right">1.43</td>
<td nowrap>15.439800</td>
</tr></tbody>
Thanks for any help I get. (although I'm yet to get any for any questions.. Is anyone reading the things but me?)

 
Old May 25th, 2005, 11:15 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Can't you give the cell an ID?
 
Old May 25th, 2005, 11:25 AM
Authorized User
 
Join Date: Dec 2004
Posts: 16
Thanks: 0
Thanked 1 Time in 1 Post
Default

I actually was able to figure this out. How would I go about giving the Cell an ID? If I could reference the cell without an ID (and I assume I'd need to reference it in order to set an ID) then I wouldn't need to give it an ID. :) Anyway, here's the code I ended up using to activate it. I am interested in how I could go about setting an ID for a cell on a webtable.

oIE.Document.getElementById("DealInfoCollateralCha racteristics_tb").getElementsByTagName("IMG").Item (0).Click
(it had the tagname IMG, as it was a clickable image.)






Similar Threads
Thread Thread Starter Forum Replies Last Post
variable used as cell reference? dabith Excel VBA 3 March 8th, 2014 12:53 AM
Using a variable to reference a cell MikeCt203 Excel VBA 2 March 24th, 2008 04:02 PM
Using Match function retrieve cell reference not wapfu Excel VBA 2 December 11th, 2006 05:09 AM
Passing the cell reference to a variable Artist Excel VBA 0 April 14th, 2004 04:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.