Results 1 to 4 of 4

Select Case Statement to test for object that may or may not be avalible

Threaded View

  1. #1
    Forum Contributor dlow's Avatar
    Join Date
    08-12-2013
    Location
    EveryWhere
    MS-Off Ver
    Excel 2007, 2010
    Posts
    275

    Post Select Case Statement to test for object that may or may not be avalible

    Hi,

    I have a For Each statement that works fine under an if statement.
       For Each ele In ieDocLand.getElementById("rg.1.117786.128366_ctl00").getElementsByTagName("div")
                    If ele.innerText = "No records to display." Then
                        If LoadWebPage(ieApp,myURL) = False Then
                                'MsgBox "Couldn't open page"
                        End If
                         Exit Sub
                    End If
                Next
    I tried putting it into a Case statement & I an get Error "object required". Thats fine too I know that the object isnt there all the time, so Excel is correct. But I want to test for its existence of my object with a Case statement.

    I tried Select Case True & I dont get the Error however I get false even when the object is present. I guess because the For loop is in the Case Statement & not being executed.

    So yeah Im stuck any help would be appreciated, TIA
    Last edited by dlow; 10-10-2014 at 11:45 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Go to Next case in a Select Statement?
    By Speshul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2014, 12:19 PM
  2. SQL select where case statement!
    By Jollyfrog in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-25-2010, 12:43 PM
  3. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM
  4. Select Case Statement Help
    By Jeugo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2006, 03:45 PM
  5. Select Case within IF-Else statement
    By rwnelson in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-06-2006, 01:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1