Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6109351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:23:41+00:00 2026-05-23T14:23:41+00:00

I have created a vba program in Excel 2007 on a 32bit XP machine

  • 0

I have created a vba program in Excel 2007 on a 32bit XP machine that runs without error. However when I try to run the same spreadsheet on a 64bit Server 2008 R2 Remote desktop services machine, I receive an unrecoverable error. Here is the code that is causing the trouble:

Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo ErrHandle

    Dim MachPhone As String
    Dim ConPhone As String

    Select Case Target.Row

    Case 12
        MachPhone = PhoneFormat(Range("B12"))
        Range("B12").Value = MachPhone
    Case 13
        ConPhone = PhoneFormat(Range("B13"))
        Range("B13").Value = ConPhone
    End Select

    ErrHandle:
        Exit Sub
        Resume

End Sub

The PhoneFormat function checks the format of a phone number and returns a formated phone number or the original string, if it can’t figure out what the phone number is.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:23:42+00:00Added an answer on May 23, 2026 at 2:23 pm

    Disabling events:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim val As String
    Dim Phone As String
    Dim rw As Long
    
        On Error GoTo ErrHandle
    
        rw = Target.Row
        If rw = 12 Or rw = 13 Then
            With Target.Parent.Cells(rw, 2)
                val = Trim(.Value)
                Phone = Phoneformat(val)
                If val <> Phone Then
                    Application.EnableEvents = False
                    .Value = Phone
                    Application.EnableEvents = True
                End If
            End With
        End If
        Exit Sub
    
    ErrHandle:
        Application.EnableEvents = True
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a VBA for Excel 2007 program that automatically creates bar graphs for
I have created an excel workbook application that is free to use; however, I
I have an Excel 2003 VBA program that creates an SQL string that way:
I have created a C# library's COM object in VBA code (Excel). This C#
I have a query that is created in VBA and selects column information from
I have an Excel file that has a bunch of VBA and macro code
I have created a VBA script that detects a number and shows a colour
I have created a macro that opens a excel workbook and performs some operations
So if you have a graph created in excel using vba, how do you
I have a problem with a VBA Add-in in Excel 2010. I've created some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.