Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
I get run time error '5' when I run this code. any sugestions?
Sub FileCopyExample()
Dim oFSO As Object Dim sSourcePath As String Dim sTargetPath As String Set oFSO = CreateObject("Scripting.FileSystemObject") oFSO.CopyFolder "C:\PNTTEMPL\CustomDoc\*", "C:\PNTTEMPL\CustomDoc\TEST\" Set oFSO = Nothing End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
I get run time error '5' when I run this code. any sugestions?
Hello Macrowriter, You need to set a reference to the Scripting Runtime library in project. 1. Open the VBA editor uising ALT + F11 2. Press ALT + T to drop down the Tools menu. 3. Press R to bring up the References dialog. 4. Search for the listing Microsoft Scripting Runtime 5. Click the checkbox on the left. A check mark indicates it is selected. 6. Press Enter to close the dialog. 7. Press ALT + S to save the change to your project. Sincerely, Leith Ross -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=493961 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run-time error '9' ---- Code to fix included. | Excel Programming | |||
run time error '424' when I run this code | Excel Programming | |||
sugestions | Excel Programming | |||
Run-time error from my code | Excel Programming | |||
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) | Excel Programming |