You are reading a single comment by @Drakien and its replies. Click here to read the full conversation.
  • Anyway, back to shit Excel questions.

    Anyone any idea why, if I save a file as a csv using a macro it saves with American format dates? If I save the exact same file manually as a csv it comes out with UK date format.

    I'm assuming there is a locale setting I've missed somewhere but I'm fucked if I know where.

    Code to save is

     ActiveWorkbook.SaveAs Filename:= _
            RootFolder & Chr(j) & h & ".csv", FileFormat _
            :=xlCSVUTF8, CreateBackup:=False
    
  • You need to add

    Local:=True
    

    to the

    ActiveWorkbook.SaveAs
    

    bit.

    Edit: assuming your PC's regional settings are correct.

  • I entirely forgot about this. That works, cheers.

    @chez_jay I don't disagree with that (also worked with too many Americans) and actually it seems that VBA happily exports in that format. Trying to convince other people is the challenge though.

About

Avatar for Drakien @Drakien started