R
Roman
I use Workbook or Worksheet SaveAs(…) methods for saving a report as CSV file
in my application. The methods work fine if I run the application on PC with
U.S. Windows XP and U.S. Office 2003/2007.
But they don’t work properly on a PC with French Windows XP SP3 and French
Office 2007. The List separator character is semi-colon in the Microsoft
Windows regional settings for the French XP. So if I save as CSV from Excel
directly is saving the separators as a semi-colon and the CSV file display
correctly in Excel.
The issue is:
If I run my application on the French PC, and generate a report as CSV, I
get saving CSV file with comma separators instead of semi-colon. And the
French Excel cannot display the file correctly. The CSV formatted file looks
like the text file (i.e. all comma delimiters shown) when displayed in the
Excel.
Looks like, if you save as CSV file programmatically Excel ignores Regional
Settings. I need the CSV file with semi-colon separators when I save it
programmatically .
How to fix the issue? Any ideas?
The same issue happens on a PC with Germany Win XP and Germany Office 2003.
There is requirement: The MS Windows regional settings cannot be changed
manually or programmatically.
My code:
bool bReadOnlyRecommended = false ;
bool bCreateBackup = false ;
bool bAddToMru = false ;
bool bLocal = true ;
oWorkbook.SaveAs(“MyFileName.csvâ€,
Microsoft.Office.Interop.Excel.XlFileFormat .xlCSV, Type .Missing, Type
..Missing, bReadOnlyRecommended, bCreateBackup,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode .xlExclusive,
Microsoft.Office.Interop.Excel.XlSaveConflictResolution
..xlLocalSessionChanges, false, Type .Missing, Type .Missing, bLocal);
Thanks,
Roman.
in my application. The methods work fine if I run the application on PC with
U.S. Windows XP and U.S. Office 2003/2007.
But they don’t work properly on a PC with French Windows XP SP3 and French
Office 2007. The List separator character is semi-colon in the Microsoft
Windows regional settings for the French XP. So if I save as CSV from Excel
directly is saving the separators as a semi-colon and the CSV file display
correctly in Excel.
The issue is:
If I run my application on the French PC, and generate a report as CSV, I
get saving CSV file with comma separators instead of semi-colon. And the
French Excel cannot display the file correctly. The CSV formatted file looks
like the text file (i.e. all comma delimiters shown) when displayed in the
Excel.
Looks like, if you save as CSV file programmatically Excel ignores Regional
Settings. I need the CSV file with semi-colon separators when I save it
programmatically .
How to fix the issue? Any ideas?
The same issue happens on a PC with Germany Win XP and Germany Office 2003.
There is requirement: The MS Windows regional settings cannot be changed
manually or programmatically.
My code:
bool bReadOnlyRecommended = false ;
bool bCreateBackup = false ;
bool bAddToMru = false ;
bool bLocal = true ;
oWorkbook.SaveAs(“MyFileName.csvâ€,
Microsoft.Office.Interop.Excel.XlFileFormat .xlCSV, Type .Missing, Type
..Missing, bReadOnlyRecommended, bCreateBackup,
Microsoft.Office.Interop.Excel.XlSaveAsAccessMode .xlExclusive,
Microsoft.Office.Interop.Excel.XlSaveConflictResolution
..xlLocalSessionChanges, false, Type .Missing, Type .Missing, bLocal);
Thanks,
Roman.