×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Excel VBA: Replace$: Sub or Function not defined

Excel VBA: Replace$: Sub or Function not defined

Excel VBA: Replace$: Sub or Function not defined

(OP)
I am using Replace$ in some VBA code in Excel without any problem.  I have distributed the file to several testers and for the most part it's ok.  

However, one user is getting "Sub or Function not defined" and the Replace$ function is highlighted.  

Does anyone know why this is happening?

RE: Excel VBA: Replace$: Sub or Function not defined

What version of Excel (and SP level) is the failing machine running, and how does that compare to all the machines that are running?

I would also check and compare the References between the failing machine and a running machine.

RE: Excel VBA: Replace$: Sub or Function not defined

(OP)
Thanks CC.  You are correct.  The failing workstations (turns out there are more than one) are running with Excel 97.  Replace$ is not supported under this version.

The .xls was created with Excel 2002.

RE: Excel VBA: Replace$: Sub or Function not defined

Makes sense.  As I see it, you have two options.  1)  Update everyone to at least 2000, or 2) write you own Replace function inside the workbook.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources