1
Vote

Import-CSVToSLDocument Number converted to Date

description

Hello,

I'm importing some CSV file to XLSX file with Import-CSVToSLDocument.
It works fine, but some number from CSV file are automatically converted by into date format.
For instance 6 2017 become 01/06/2017 (in French date format which is dd/mm/yyyy)

I know it's problem related more to Excel than powershell but maybe someone could help ?
import-module SLPslib
##create new XLSX doc
$doc = New-SLDocument -WorkbookName CSVtoExcel -Path X:\powershell -PassThru -verbose -force

##import each csv file in folder 
get-childitem -path X:\powershell\csv -filter *.csv | Import-CSVToSLDocument  -WorkBookInstance $doc -ImportStartCell A1 -AutofitColumns  -Confirm 

##remove default sheet1 and save document
$doc | Remove-SLWorkSheet -WorkSheetName sheet1 -verbose
$doc | Save-SLDocument -verbose

comments