saving as text adding extra quotes?

C

Corey Wirun

Hi All,

This problem has been driving me crazy! ;) I have a worksheet that I am
trying to save as text. The problem is that there are text cells that have
quotes that I need saved verbatim. In a macro I have, when I Save-As the
worksheet in text format (xlTextMSDOS), I get extra double quotes for every
cell that has them.

For example:

Cell A25 contents: #include
Cell B25 contents: "iisysdef.rh"

When I save the worksheet as text format I get:

#include """iisysdef.rh"""

Here is my macro:

Cells.Select
ActiveWorkbook.SaveAs Filename:=szTargetFileName,
FileFormat:=xlTextMSDOS, CreateBackup:=False

Can anyone shed light why I get all the extra quotes? I've tried putting a
single quote in front of the contents of B25 and I've tried concatenating
B25 into A25, but that makes it:

"#include ""iisysdef.rh"""

I ultimately need:

#include "iisysdef.rh"

Thanks in advance!
Corey.
 
C

Corey Wirun

Thanks Matt!

That got me a lot closer. All I had to do was increase some column widths
and that prevented some 'concatenation' of strings between adjacent cells in
the same row.

Corey.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top