Results 1 to 4 of 4

Find Property of Worksheet Function Class

Threaded View

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    Apex, NC, USA
    MS-Off Ver
    Office 365
    Posts
    64

    Find Property of Worksheet Function Class

    Within a For Each loop, I am using the WorksheetFunction.Find to locate a specific string in another string.
    The find works on iteration 1 and 2 but on third gets:


    Run-Time Error 1004 ... Unable to get the Find property of the WorksheetFunction class.

    Here is the code:

    Option Explicit
    Sub MoveCCx()
    Dim ccnumber As String
    Dim Mybody As String
    
    
    Dim MySubject As String
    Dim MyTitlePointer As Integer
    
    Dim olItems As Outlook.items
    Dim olItem As Outlook.MailItem
    Set olItems = session.getdefaultfolder(olfolderinbox).items
    ccnumber = "1234-5678-8901-2345"
    For Each olItem In olItems
    MySubject = olItem.Subject
    MsgBox MySubject, Buttons:=vbOKOnly
    On Error GoTo NotFound
    MyTitlePointer = 0
    MyTitlePointer = WorksheetFunction.Find("WINTER", UCase(MySubject))  '<--PROBLEM
    If MyTitlePointer > 0 Then
    MsgBox "found  Your " & MyTitlePointer & MySubject
    Mybody = olItem.Body & ccnumber
    olItem.Body = Mybody
    Else
    
    End If
    NotFound:
    Next olItem
    
    End Sub
    The Value of MySubject when the failure occurs is:

    PHP Code: 
    Dan BlumEnjoy clearsimple pricing from the trusted name in online payments
    What am I doing on the first or second loop iteration to cause this?

    I am running on Office 10 on Windows 7

    The overall code is part of prototyping to see if I can add some text to specific emails (that have a keyword in the subject line) in my inbox. It works until the third email in the inbox.

    Thanks for any help!
    Last edited by DanBlum; 12-01-2014 at 09:09 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] unable to get the vlookup property of the worksheet function class
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-17-2014, 09:35 AM
  2. unable to get the vlookup property of the worksheet function class
    By zak.horrocks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2014, 08:01 AM
  3. [SOLVED] unable to get the sumif property of the worksheet function class -> HELP!!!
    By stadjer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2012, 07:32 AM
  4. Unable to Match property of Worksheet class function
    By bambino_32 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2010, 05:38 AM
  5. Unable to get countif property of the worksheet function class
    By mikeyfear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2008, 06:53 PM

Tags for this Thread

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