RE: Export to CSV file problems

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



PS

I missed a comma in my argument list:

ActiveWorkbook.SaveAs Filename:= _
"C:\FILES\TEST.csv", _
FileFormat:=xlCSV, CreateBackup:=False, _
Local:=True

Sean.

--
(please remember to click yes if replies you receive are helpful to you)


"SeanC UK" wrote:

Hi Ixtreme,

The problem is that when you automate the save process it is using the
language of VBA and not the regional settings.

Simply add the extra argument to your command and it should use the regional
settings:

ActiveWorkbook.SaveAs Filename:= _
"C:\FILES\TEST.csv", _
FileFormat:=xlCSV, CreateBackup:=False _
Local:=True


This should do the trick (in The Netherlands or Denmark ;-) ).

Hope this helps,

Sean.

--
(please remember to click yes if replies you receive are helpful to you)


"Ixtreme" wrote:

Hi all,

I have MS Excel 2002 SP3 installed.
I need to create a CSV file with ~ as the delimiter. I customized my
current (dutch) Regional settings List delimiter to ~. So far so good.
Once I open my excel file and do a save as, select CSV file and click
on Save, I have exactly what I need. Upon opening the file with
Notepad, all records are separeted with ~.

However, I would like to automate this. I record a macro of the above
action which resulted in something like this:

ActiveWorkbook.SaveAs Filename:= _
"C:\FILES\TEST.csv", _
FileFormat:=xlCSV, CreateBackup:=False

But If I open that file with Notepad, all fields are separeted by
comma's :-(

The questions is: WHY? and how can I prevent this from happening? I
want my ~ as the delimiter.


.



Relevant Pages

  • Re: Properly displaying items from hash
    ... The program extracts the values after the -> delimiter of both files ... CA FILENAME => AA_FILENAME ... How do I get the desired output without resorting to the 'double pop'? ... You could accomplish the same thing more simply with a hash slice: ...
    (perl.beginners)
  • Re: How do I add insert filepath command to a button?
    ... "Jay Freedman" wrote: ... please understand that email replies to newsgroup posts are rare. ... Initially the button will have just the text "Filename and path". ...
    (microsoft.public.word.docmanagement)
  • Re: Extract lines from files
    ... % Loop over each ... % Make a new filename ... newfilename = sprintf; ... % Write to a delimited file using a space as the delimiter ...
    (comp.soft-sys.matlab)
  • Re: Writing formatted text files when column number of the ouput is uncertain?
    ... the matrix dimension got changed. ... FILENAME using ',' as the delimiter to ... FILENAME using the character DLM as the ...
    (comp.soft-sys.matlab)
  • Re: manage blankspaces in filenames
    ... bad idea to assume that file names don't contain white spaces. ... delimiter" to use something which means something spacial like that in the ... filename is simply asking for trouble. ... Would you also put single quotes ...
    (alt.os.linux)