Results 1 to 20 of 20

Run time error '13' - type mismatch

Threaded View

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    ENGLAND
    MS-Off Ver
    Excel 2007
    Posts
    39

    Run time error '13' - type mismatch

    Hello

    I've posted this same question in another forum, but got no responses, I'm hoping someone here can help me!

    I have the run time error '13' type mismatch problem on the line that I have bolded. I think I understand why the problem occurs, I just don't know how to solve it.

    What is really annoying about it all is that we don't get the error in Excel 2007 at all until the file is sent in an email, used in Excel 2010, and when it's sent back to be used in Excel 2007 again, the problem arises. I have to then revert to the backed up original '07 file before it was sent in the email.

    Basically, this spreadsheet is used to send text messages to numbers in certain columns. If the relevant cell is empty, this error handler kicks in to collect a number from the user.

    Code:

    Dim PhNum As String
    ......
    errhandler:
        With Application
            .ScreenUpdating = True
            .EnableEvents = True
        End With
    
        With ActiveSheet.Buttons(MyButton)
        PhNum = Application.InputBox("Phone number for employee missing. Text not sent." & vbNewLine & "Check name and employee number." & vbNewLine & vbNewLine & "If you know the number, type it into the box below," & vbNewLine & "WITHOUT ANY LEADING ZEROS AND WITH THE COUNTRY CODE I.E. 447906684330", Title:="Employee Contact", Default:=IIf(Range(.TopLeftCell, .BottomRightCell).Offset(, -2) >= "0", (Range(.TopLeftCell, .BottomRightCell).Offset(, -2).Value), "Enter the number here"), Type:=1)
        If PhNum = vbNullString Then
        ElseIf PhNum = "false" Then
        Exit Sub
    Is there a code solution with the whole Excel 2007/2010 problem?

    Any help you could give would be amazing.
    thanks!
    Last edited by a8747; 05-18-2012 at 05:20 AM.

Thread Information

Users Browsing this Thread

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

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