Home Excel Powerpoint Word Outlook Error Codes

VBA Useful Codes

Welcome to the World of VBA
Home > VBAUsefulCodes

Copy a File from One Place to Another using File System Object


Copy Files using File System Object from one place to another.

' Add Reference to Microsoft Scripting Runtime

Sub CopyFile()
Dim MyFSO As FileSystemObject
Dim SourceFile As String
Dim DestinationFolder As String
Set MyFSO = New Scripting.FileSystemObject

SourceFile = "C:\SourceFile.xlsx"
DestinationFolder = "C:\Destination"

MyFSO.CopyFile Source:=SourceFile, Destination:=DestinationFolder & "\SourceFile.xlsx"

End Sub

Subscribe

Enter your e-mail below and get notified on the latest blog posts.




Tags

VBA Outlook KPI Excel Alt+F11 Dashboards Macros Recording Graphs Automation Developer WaterFall Powerpoint Charts Pivot Tables Forecast Charts


Follow Us