If I have an Excel worksheet with a single cell populated with 09:00:00 and export it manually as 'Text (tab delimited)' it outputs a text file containing 09:00:00.
However, if I write the following macro:
Sub SaveAsTextTabSeparated()
Dim Filename As String
Filename = CreateObject("WScript.Shell").specialfolders("Desktop") & "\" & "test-macro.txt"
ActiveWorkbook.SaveAs Filename, xlText
End Sub
The output is then 9:00:00 without the leading 0.
I've tried several of the XlFileFormat options as show here but they all exhibit this behaviour.
Have I missed some additional argument for the SaveAs method or is it not possible to replicate the behaviour of the manual export?