Es fundamental interpretar el código bien antes de utilizarlo a tu trabajo si tdeseas aportar algo puedes comentarlo.
Ejemplo: código vba para descargar archivos desde otra carpeta
'In this Example I am Copying the File From "C:Temp" Folder to "D:Job" FolderSub sbCopyingAFile()'Declare VariablesDim FSO
Dim sFile AsStringDim sSFolder AsStringDim sDFolder AsString'This is Your File Name which you want to Copy
sFile ="Sample.xls"'Change to match the source folder path
sSFolder ="C:Temp"'Change to match the destination folder path
sDFolder ="D:Job"'Create ObjectSet FSO = CreateObject("Scripting.FileSystemObject")'Checking If File Is Located in the Source FolderIfNot FSO.FileExists(sSFolder & sFile)Then
MsgBox "Specified File Not Found", vbInformation,"Not Found"'Copying If the Same File is Not Located in the Destination FolderElseIfNot FSO.FileExists(sDFolder & sFile)Then
FSO.CopyFile (sSFolder & sFile), sDFolder,True
MsgBox "Specified File Copied Successfully", vbInformation,"Done!"Else
MsgBox "Specified File Already Exists In The Destination Folder", vbExclamation,"File Already Exists"EndIfEndSub
Te invitamos a favorecer nuestra función dejando un comentario o valorándolo te damos la bienvenida.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)