Results 1 to 10 of 10

Copy all Files From K:\ drive to a folder

Threaded View

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Copy all Files From K:\ drive to a folder

    I have a macro that works but I'm trying to schedule it with Windows Scheduler to run at a certain time in the "Run whether user is logged on or not" mode. I have multiple macro's that I'm doing the same thing and have no problems with them. This macro is set up as WorkBook_Open and runs great when I double click on it and also in the "Run only when user is logged on" mode. I am at a loss. I have looked at everything on this site about copying along with all over the internet and i've tried every code I could find. Some worked some did not, but none worked in the "Run whether user is logged on or not" mode. Any help would be appreciated.
    The files are all .txt files.
    I'm on a work computer and have Admin Rights
    Windows 7 Enterprise
    Microsoft Office Professional Plus 2007

    Private Sub WorkBook_Open()
    'CopyAllFiles
    
    Dim oFso As Object
    Set oFso = CreateObject("Scripting.FileSystemObject")
    oFso.CopyFile "K:\*.*", "\\RETUS211-NT0001.ikea.com\Common\Logistics\Chris\K_Drive\2013\today"
    
    
    'ThisWorkbook.Saved = True
    'Application.Quit
    
    ActiveWorkbook.Save
    ActiveWorkbook.Close
    
    End Sub
    Last edited by jeffreybrown; 06-29-2013 at 09:03 AM. Reason: As per Forum Rule #3, please use code tags…Thanks.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1