Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save as CSV with semicolon separator

I'm currently use this function for saving, but I have a problem with it:

Private Sub spara()
    ActiveWorkbook.SaveAs Filename:="T:\filepath+ ActiveWorkbook.Name", _
    FileFormat:=xlCSV, CreateBackup:=False
End Sub

It automatically saves with , but I need it to save with ; in its file. Is it possible to change how it saves somehow?

I've tried googling around for this issue, but all macros regarding .csv file saving are just how to save in .csv and how to split multiple sheets to .csv .

like image 921
saknar namn Avatar asked Oct 09 '13 07:10

saknar namn


1 Answers

I solved it adding "SaveChanges:=False" when closing workbook

With ActiveWorkbook
     .SaveAs Filename:="T:\filepath+ ActiveWorkbook.Name", FileFormat:=xlCSV, Local:=True
     .Close SaveChanges:=False
End With
like image 117
Lionel T. Avatar answered Oct 05 '22 17:10

Lionel T.