Re: How do I export integer data with leading zeros



Hi Mark,

I have a nasty feeling that there's antique code in the export routine,
dating from the days when a filename couldn't include dots (apart from
the one between the name and the extension). The only work-round I can
think of is to export the file with a simple name and then rename it,
e.g (in VBA)

Name "D:\Folder\Simple.csv" As "D:\Folder\Long.Name.With.Periods.csv"

As far as I know there isn't a macro action for renaming files, but you
can use a little VBA function

Public Function RenameFile( _
OldName As String, _
NewName As String)

'OldName: path and name of file to rename or move
'NewName: path and name of destination
Name OldName As NewName
End Function

and call it with the RunCode macro action.

On Fri, 25 Aug 2006 15:04:03 -0700, MarkSH
<MarkSH@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

How do I include periods in my file names when using the TansferText macro?
My file name that I'm transfering looks something like this
TT30UDLK.PERM.FILE13.csv,
but when I look on the receving server, the file name appears like this
TT30UDLK#PERM#FILES13.csv. The two inner periods are replaced with "#". I
can't use a different file name because a process on the receiving server is
expecting the file name to be in a certain format. Any ideas? Thanks....

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
.



Relevant Pages

  • Re: File Rename n ot working???
    ... Third, substitute Name for Rename. ... Public Sub Rename() ... Dim OldName, NewName As String ...
    (microsoft.public.vb.general.discussion)
  • RE: What is wrong with this code?
    ... method to put the file there after you rename it. ... Dim OldName As String ... Dim NewName As String ...
    (microsoft.public.excel.programming)
  • Re: File Rename n ot working???
    ... Name OldName As NewName ... > Sub Rename() ... > Dim OldName, NewName As String ...
    (microsoft.public.vb.general.discussion)
  • Re: append current date to filename
    ... > Name OldName As NewName 'rename the file. ... Dim OldName As String ... Dim NewName As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Macro for Changing Files Names
    ... Dim MyPath As String, MyFilename As String ... Dim OldName() As String, NewName As String ... Dim Prefix As String ...
    (microsoft.public.word.vba.general)