Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text Qualifiers | Excel Discussion (Misc queries) | |||
How do I remove text qualifiers from imported data? | Excel Discussion (Misc queries) | |||
Excel ignores "Text qualifiers" in Unicode files | Excel Discussion (Misc queries) | |||
Saving as a csv file with text qualifiers | Excel Discussion (Misc queries) | |||
How to parse a csv string with text qualifiers | Excel Programming |