View Single Post
  #5   Report Post  
MaxFrance
 
Posts: n/a
Default

I'll try this, could be the answer, unfortunately for any french analysis I
prepare using any excel system, I am obliged by the companies to implement
their number system - commas as opposed to points for the decimal break!
I'll let you know what happens. Thanks

"Jim Rech" wrote:

If there are commas in your data then you will get quotes with a macro,
despite having French setting (I assume). When a macro runs Excel is thrown
into "US settings mode" where a comma is the list separator. In order to
distinguish separator commas from data commas quotes are used.

You might try using this macro which gives you more control over the output:

''No quotes around strings
''Outputs the selection if more than one cell is selected, else entire sheet
Sub OutputActiveSheetAsTrueCSVFile()
Dim SrcRg As Range
Dim CurrRow As Range
Dim CurrCell As Range
Dim CurrTextStr As String
Dim ListSep As String
Dim FName As Variant
FName = Application.GetSaveAsFilename("", "CSV File (*.csv), *.csv")
If FName < False Then
ListSep = Application.International(xlListSeparator)
'ListSep = "," 'use this to force commas as separator regardless of
regional settings
If Selection.Cells.Count 1 Then
Set SrcRg = Selection
Else
Set SrcRg = ActiveSheet.UsedRange
End If
Open FName For Output As #1
For Each CurrRow In SrcRg.Rows
CurrTextStr = ""
For Each CurrCell In CurrRow.Cells
CurrTextStr = CurrTextStr & CurrCell.Value & ListSep
Next
While Right(CurrTextStr, 1) = ListSep
CurrTextStr = Left(CurrTextStr, Len(CurrTextStr) - 1)
Wend
Print #1, CurrTextStr
Next
Close #1
End If
End Sub

--
Jim Rech
Excel MVP
"MaxFrance" wrote in message
...
| If I save (using a macro) an excel file as a text file MSDOS (not tab
| delimited), I get a file with quotation marks at the start and end of each
| line! If I do the process manually the file is perfect. Can someone help
!!
|
| Excel 2000 all updates done
| XP prof all updates done (with sp2)
|
| Thanks