?
Solved

How do I replace "&" in vb6?

Posted on 2003-02-22
7
Medium Priority
?
166 Views
Last Modified: 2010-04-07
hi, I know that

strFormattedString = Replace(strUnformattedString, Chr(39), "")
  GetCleanString = strFormattedString

will replace an apostrophe with a blank, but is there a # that will replace an ampersand?   My XML document is not happy with them in it...  
  Thanks in advance!

 -Al
0
Comment
Question by:afeld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 

Expert Comment

by:Dagor
ID: 8000744
You can also use the common name for this as follows:

strFormattedString = Replace(strUnformattedString, "&", "")
 GetCleanString = strFormattedString
0
 

Author Comment

by:afeld
ID: 8000795
I tried that, and it still returned an XML document with the same error...  
0
 
LVL 2

Expert Comment

by:Chuckie_Ice
ID: 8000864
to answer this in the way your looking for, & = 38

strFormattedString = Replace(strUnformattedString, Chr$(38), "")
GetCleanString = strFormattedString

Also, i used Chr$(38) instead of Chr(38),this may help
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Accepted Solution

by:
Chuckie_Ice earned 200 total points
ID: 8000866
to answer this in the way your looking for, & = 38

strFormattedString = Replace(strUnformattedString, Chr$(38), "")
GetCleanString = strFormattedString

Also, i used Chr$(38) instead of Chr(38),this may help
0
 

Author Comment

by:afeld
ID: 8000877
I tried that, and it still returned an XML document with the same error...  
0
 

Author Comment

by:afeld
ID: 8000913
Still no luck...  
0
 

Author Comment

by:afeld
ID: 8001008
whoops, I am stupid.  I was cleaning it for &'s and for apostrophes, and it went back to the & before the second clean.   It works now.  Thanks!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question