Error 2023

Discussion in 'Excel Beginners' started by KarateB, Apr 17, 2014.

  1. KarateB

    KarateB Guest

    Ok new user here so be gentle :)

    Long story short, Im working with a excel database for a karate studi
    that was designed by someone who is no longer with us. I am trying t
    run an action that creates and prints labels and when i do I get a ru
    time error. The following is what shows up when i debug. If more info i
    needed let me know, this database contains some sensitive info so I'
    trying to be careful of what I post.

    x.Selection.TypeParagraph

    ' Change font back so it is not red for rest of label
    x.Selection.Font.ColorIndex = wdBlack
    x.Selection.Font.Name = "Courier New"

    '*
    '* Format Phone Info
    '*
    x.Selection.Font.Bold = wdToggle
    x.Selection.TypeText Text:="Phones: "
    x.Selection.Font.Bold = wdToggle
    If (DadCellPhone <> "") And (MomCellPhone <> "") Then
    x.Selection.TypeText Text:=Left("Mc-" & MomCellPhone &
    Dc-" & DadCellPhone, 33)

    ElseIf (DadCellPhone = "") And (MomCellPhone <> "") Then
    x.Selection.TypeText Text:=Left("Mc-" & MomCellPhone &
    H-" & Homephone, 33)

    ElseIf (DadCellPhone <> "") And (MomCellPhone = "") Then
    x.Selection.TypeText Text:=Left("Dc-" & DadCellPhone &
    H-" & Homephone, 33)

    ElseIf (DadCellPhone = "") And (MomCellPhone = "") An
    (DadWorkphone <> "") Then
    x.Selection.TypeText Text:=Left("H-" & Homephone & " Dw-
    & DadWorkphone, 33)

    ElseIf (DadCellPhone = "") And (MomCellPhone = "") An
    (MomWorkPhone <> "") Then
    x.Selection.TypeText Text:=Left("H-" & Homephone & " Mw-
    & MomWorkPhone, 33)

    End If


    The line " If (DadCellPhone <> "") And (MomCellPhone <> "") Then
    x.Selection.TypeText Text:=Left("Mc-" & MomCellPhone &
    Dc-" & DadCellPhone, 33)" is highlighted yellow and gives a refrenc
    error but Im not sure how to go about fixing it. Any help is greatl
    appreciated. If you need more info please let me know. Thanks agai
    everyone


    --
    KarateB
     
    KarateB, Apr 17, 2014
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PT
    Replies:
    1
    Views:
    154
    Jim Rech
    Jan 14, 2004
  2. Hornet

    Exract Data And Error Msg

    Hornet, Jan 14, 2004, in forum: Excel Beginners
    Replies:
    1
    Views:
    123
    Julia0001
    Jan 15, 2004
  3. Vijaya Bhaskar Utla

    A Strange ERROR

    Vijaya Bhaskar Utla, Jan 16, 2004, in forum: Excel Beginners
    Replies:
    2
    Views:
    125
    Gord Dibben
    Jan 17, 2004
  4. Michel

    Error in macro.

    Michel, Jan 19, 2004, in forum: Excel Beginners
    Replies:
    1
    Views:
    143
    Mark Graesser
    Jan 19, 2004
  5. Ann

    Error bars

    Ann, Jan 24, 2004, in forum: Excel Beginners
    Replies:
    1
    Views:
    118
    Andy Pope
    Jan 25, 2004
  6. SKS
    Replies:
    2
    Views:
    392
  7. star_lucas

    Runtime error '1004' General ODBC error

    star_lucas, Aug 29, 2005, in forum: Excel Beginners
    Replies:
    0
    Views:
    310
    star_lucas
    Aug 29, 2005
  8. Replies:
    0
    Views:
    226
Loading...