Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Writing text string with imbedded quotes to a text stream

I want to write a series of comand line strings having imbedded quotes like
this to a command file (.cmd),

erase "C:\Essay\FE8 Teachers\Code Files.SAS" /Q

Can this be done? (I'm sure it can but I cannot figure out how to do it.)
The quotes are necessary because of the possiblity of spaces in parameters of
the command written to the export file.

The key VBA statement that writes these command line strings is:

OutArray(I) = "erase " & "'" & cel(I, 3) & cel(I, 2) & "'" & " /Q" &
vbCrLf

The resulting .cmd file will be executed from a command line window.

As you can see from the code, I am currently using the string "'" to insert
'quotes' around the command lline parameters.

Unfortunately, this does not work. Command line parameters must be brackets
with full fledged quotes (command "param1" "param2") and not asn apostrophe.

How can I include quotes (") in an output string written to a textfile in VBA?

Thank you.

John Wirt



T



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Writing text string with imbedded quotes to a text stream

John, two quotes ("") within a string will result in one being output.
try:

OutArray(I) = "erase " & """" & cel(I, 3) & cel(I, 2) & """" & " /Q" &
vbCrLf


Fred


"John Wirt" wrote in message
...
I want to write a series of comand line strings having imbedded quotes like
this to a command file (.cmd),

erase "C:\Essay\FE8 Teachers\Code Files.SAS" /Q

Can this be done? (I'm sure it can but I cannot figure out how to do it.)
The quotes are necessary because of the possiblity of spaces in parameters
of
the command written to the export file.

The key VBA statement that writes these command line strings is:

OutArray(I) = "erase " & "'" & cel(I, 3) & cel(I, 2) & "'" & " /Q" &
vbCrLf

The resulting .cmd file will be executed from a command line window.

As you can see from the code, I am currently using the string "'" to
insert
'quotes' around the command lline parameters.

Unfortunately, this does not work. Command line parameters must be
brackets
with full fledged quotes (command "param1" "param2") and not asn
apostrophe.

How can I include quotes (") in an output string written to a textfile in
VBA?

Thank you.

John Wirt



T





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Writing text string with imbedded quotes to a text stream

Thansk. will try. John
I tried three (""") but it didn't work.

"Fred" <leavemealone@home wrote in message
...
John, two quotes ("") within a string will result in one being output.
try:

OutArray(I) = "erase " & """" & cel(I, 3) & cel(I, 2) & """" & " /Q" &
vbCrLf


Fred


"John Wirt" wrote in message
...
I want to write a series of comand line strings having imbedded quotes

like
this to a command file (.cmd),

erase "C:\Essay\FE8 Teachers\Code Files.SAS" /Q

Can this be done? (I'm sure it can but I cannot figure out how to do

it.)
The quotes are necessary because of the possiblity of spaces in

parameters
of
the command written to the export file.

The key VBA statement that writes these command line strings is:

OutArray(I) = "erase " & "'" & cel(I, 3) & cel(I, 2) & "'" & " /Q" &
vbCrLf

The resulting .cmd file will be executed from a command line window.

As you can see from the code, I am currently using the string "'" to
insert
'quotes' around the command lline parameters.

Unfortunately, this does not work. Command line parameters must be
brackets
with full fledged quotes (command "param1" "param2") and not asn
apostrophe.

How can I include quotes (") in an output string written to a textfile

in
VBA?

Thank you.

John Wirt



T







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumif text is contained winthin a longer text string in a cell Johnny M[_2_] Excel Worksheet Functions 3 March 21st 07 02:50 PM
Saving as Text (tab delimited) surrounds text with "quotes" Mike521 Excel Discussion (Misc queries) 2 June 8th 06 02:28 PM
saving an excel file as text without text in quotes John Excel Discussion (Misc queries) 2 December 6th 05 06:20 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 09:56 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 12:25 AM


All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"