Alguien me podria ayudar por favor con esta macro ya que soy contador y
estoy aprendiendo el uso de macros, necesito cambiarle el nombre a varios
archivos,
de a ubicados en
20050111.072 20050111_SB_534_001.1101 C:\SIEFB1L\CONSAR
20050111.062 20050111_SB_534_002.1101 C:\SIEFB2L\CONSAR
20050111.124 20050111_AV_634_001.1101 C:\SIEFAV1L\CONSAR
Y me puse hacer el siguiente codigo y no me quedo.
Private Function BuscarSigDiaHabil(ByVal Fecha As Date) As String
Dim DiaDeHoy As String
DiaDeHoy = StrConv(Format(Fecha, "ddd"), vbLowerCase)
Select Case DiaDeHoy
Case "vie", "fri": BuscarSigDiaHabil = Format(Fecha + 3, "yyyymmdd")
Case "sáb", "sab", "sat": BuscarSigDiaHabil = Format(Fecha + 2,
"yyyymmdd")
Case Else: BuscarSigDiaHabil = Format(Fecha + 1, "yyyymmdd")
End Select
End Function
Sub CambiarNombreArchivo()
Dim FSO As Object 'FileSystemObject
Dim Archivo As Object 'File
Dim ArchivoN As String
'New FileSystemObject
ArchivoN = BuscarSigDiaHabil(Date) & ".072"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Archivo = FSO.GetFile("C:\" & ArchivoN & ".072")
Archivo.Name = ArchivoN & "_SB_534_001.1101"
Set Archivo = Nothing
Set FSO = Nothing
End Sub
Me manda error , dice Archivo no encontrado en esta linea
Set Archivo = FSO.GetFile("C:\" & ArchivoN & ".072")
Espero que me puedan echar una mano por favor.
Leer las respuestas