+ Reply to Thread
Results 1 to 3 of 3

saving as text adding extra quotes?

  1. #1
    Corey Wirun
    Guest

    saving as text adding extra quotes?

    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.



  2. #2
    Matt H
    Guest

    Re: saving as text adding extra quotes?

    Corey, try changing xlTextMSDOS to xlTextPrinter. Cheers, Matt H


    Corey Wirun wrote:
    > 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.



  3. #3
    Corey Wirun
    Guest

    Re: saving as text adding extra quotes?

    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.

    "Matt H" <[email protected]> wrote in message
    news:[email protected]...
    > Corey, try changing xlTextMSDOS to xlTextPrinter. Cheers, Matt H
    >
    >
    > Corey Wirun wrote:
    > > 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.

    >




+ Reply to Thread

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