Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Exporting to CSV without text qualifiers

Hi guys,
I've been fiddling with VBA again, and seem to have come unstuck.
I work at a cabinetmakers, and I'm writing a macro to export a list of
parts to a program that talks to our saw. The program uses a CSV file
to read in all the sizes, descriptions etc etc.

Problem is, that i need one of the fields to equal " " (with the
qualifiers)
I've tried the following, and countless others, but these seem to be
the closest

Workbooks(Paste_Book).Activate 'D = " " (Material String
Field 2)
Range("D1:D" & bot2).Value = """ """

Workbooks(Paste_Book).Activate 'D = " " (Material String
Field 2)
Range("D1:D" & bot2).Value = " "

The first looks right when I open the xls file (before it exports to
csv), but after the exporting, it gives me """ """ in the cell

the second gives me a space only in excel, and after the exporting,
also leaves me with only a space... and no qualifiers

hope that made a little bit of sense, and i hope someone here can help.

thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Exporting to CSV without text qualifiers

as a further note,
the saw program requires text qualifers ("" 's) surrounding each
non-numerical field. and they only seem to be written into the CSV when
there is non alpha-numerical characters in the cell (ie. the text
qualifer ")
so if i leave the text qualifiers out i get none.. and if i put them in
(before the exporting) then i end up with 3!

i only want one =(

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Exporting to CSV without text qualifiers

and in case this has something to do with it (probably is where the
problem lies..)

the following is the line i eventually use to export to CSV

ActiveWorkbook.SaveAs Filename:=thisname & ".pts", FileFormat:= _
xlCSVMSDOS, CreateBackup:=False

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Exporting to CSV without text qualifiers

at the moment, i'm running my macro, then opening the exported CSV file
in notepad, and doing a find/replace """ with "
this fixes it right up and the saw program can open it no worries...

as much as i enjoy talking to myself, i think i'll leave it to the
experts now.
either a way to stop excel adding its own text qualifiers, or even a
workaround way to make notepad or similar do the replacing
automatically, would be much appreciated

thanks in advance,
Dan

(centurius [at] hotmail dot com)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Exporting to CSV without text qualifiers

Perhaps this code to write your file:

http://www.cpearson.com/excel/imptext.htm import/export text files

--
Regards,
Tom Ogilvy

"Centurius" wrote in message
ups.com...
at the moment, i'm running my macro, then opening the exported CSV file
in notepad, and doing a find/replace """ with "
this fixes it right up and the saw program can open it no worries...

as much as i enjoy talking to myself, i think i'll leave it to the
experts now.
either a way to stop excel adding its own text qualifiers, or even a
workaround way to make notepad or similar do the replacing
automatically, would be much appreciated

thanks in advance,
Dan

(centurius [at] hotmail dot com)



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
Text Qualifiers Wavequation Excel Discussion (Misc queries) 1 June 3rd 10 08:44 PM
How do I remove text qualifiers from imported data? Gail Baker Excel Discussion (Misc queries) 0 October 26th 06 05:51 PM
Excel ignores "Text qualifiers" in Unicode files Doug Excel Discussion (Misc queries) 0 June 8th 06 09:30 PM
Saving as a csv file with text qualifiers Rajendra Pai Excel Discussion (Misc queries) 2 January 18th 05 07:45 PM
How to parse a csv string with text qualifiers Janelle Excel Programming 16 October 8th 04 08:00 PM


All times are GMT +1. The time now is 05:31 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"