Task Scheduler or VBA to simple copy periodically folders contents to external drive

I need to copy periodically all files (without any other data
 from folders W, X, Y on Drive C to folder Z on Drive D.
Any existing files would ge ovewritten without prompting.
Is it more convenient to process this through Windows Task Scheduler
or through VBA ?

Help appreciated,

3/5/2010 9:52:56 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 36

If you need to work only with files, not subfolders, you can use code
like the following:

Sub AAA()
    Dim FromFolders As Variant
    Dim ToFolder As String
    Dim N As Long
    Dim FName As String
    FromFolders = Array("C:\Test", "C:\Test2")
    ToFolder = "D:\Z"
    Application.DisplayAlerts = False
    For N = LBound(FromFolders) To UBound(FromFolders)
        ChDrive FromFolders(N)
        ChDir FromFolders(N)
        FName = Dir("*.*", vbNormal)
        Do Until FName = vbNullString
            On Error Resume Next
            Kill ToFolder & "\" & FName
            On Error GoTo 0
            Name FName As ToFolder & "\" & FName
            FName = Dir()
    Next N
End Sub

Chip Pearson
Microsoft Most Valuable Professional,
	Excel, 1998 - 2010
Pearson Software Consulting, LLC

On Fri, 5 Mar 2010 13:52:56 -0800 (PST), u473 <u473@aol.com> wrote:

>I need to copy periodically all files (without any other data
> from folders W, X, Y on Drive C to folder Z on Drive D.
>Any existing files would ge ovewritten without prompting.
>Is it more convenient to process this through Windows Task Scheduler
>or through VBA ?
>Help appreciated,
3/5/2010 10:03:02 PM

Similar Artilces:

Simple worksheet becomes large and slow
I use 2 simple worksheets daily. They contain little data and should be less than 50k. I change them by copying data from various other spreadsheets into them, then saving or saving as with a new name. Some of these spreadsheets for some reason become very large (1.5mb or more) and moving from cell to cell becomes very slow. Copying from those spreadsheets to new sheets can take up to 30 seconds for a single cell to copy. There is nothing complex in any of them, just text, some multiplication and sum. The sheets eventually become so slow that the only way I can work with them is b...

how to query my web site from VBA and return a value to VBA
Hello All, From VBA I would like send a value to my web site, and have it return a value. I've learned how to use FollowHyperlink to send a value to an ASP script, but how can the ASP script send a value back to VBA?? Thanks, Brian Austin, TX You can use xmlhttp to make a request to your web page: '********************************************************* Sub Tester() MsgBox WebResponse("http://www.mydomain.com/myactualpage.asp? info=3Dblah") End Sub Private Function WebResponse(sURL As String) As String Dim XmlHttpRequest As Object Se...

Just installed new hard drive
I just installed a new hard drive and used the drive's utility program to copy everything from my old drive to the new one. Now Outlook isn't going out to my ISP's server and getting my new messages, and when I send a message I get the "no transport provider available" error. (My connection's just fine.) I looked online for some help. One recommendation was to delete the Personal Folder and create a new one. I did that, but then all the messages I had disappeared and it freaked me out so I didn't want to mess with anything else. How can I make it work ...

copy of exchange 2000
I don't suppose microsoft is providing Exchange 2000 as a free download anywhere are they?? Until we can afford to move up to SBS 2008 (hopefully later this year), I want to trash our SBS 2000 (too many issues with it) and simply install a win2k server with Exchange until we can move on. We are not using any of the other SBS components any longer anyway... If anyone knows where I might be able to get this from, I would be very appreciative! Thanks, Brad Why not look at BPOS? $10 per user a month it's a great inexpensive solution. You may find you do not ne...

Cannot open assigned task in Outlook 2003 #2
I am using Outlook 2003 on a XP Home PC. When a co-worker creates and assigns me a task, it comes into my Inbox and I can see it in my preview pane, but I cannot open it when I double-click it and I cannot accept or decline it thru the preview pane. My co-worker has Outlook 2003 on a XP Pro PC and has no problem opening and accepting tasks from me. By the way....when I attempt to open it, absolutely nothing happens that I can see....no error, no change of screens, nothing! I have ensured that when the co-worker sends the task, that they do NOT have "text only" set for me. THANKS...

Printing Multiple Copies #4
Hi all - I am using Vista Business and Publisher 2007 from the Office 2007 Small Business package. No matter what type of publication or template I use I can only print single copies. Most recently I tried to print 30 copies of a single page flyer and had to do it a single copy at a time. If I go to File|Print and set the number of copies to 30, I still get a single copy only. Does anyone have any thoughts? Thanks -- Andrew Aitchison (amhsn@nospam.sympatico.ca) Is your printer driver current? What is the default in the printing preferences in the control panel printer folder? ...

How do I export my emails and folders from Outlook to Thunderbird
I'm trying to export my email from and all personal folders from Outlook to Thunderbird. Any help would be appreciated. Thanks, Sam ...

Save As using contents of Cell in Name
Can someone help with code that changes the "save As" file name to combination of the original File Name + the contents of a cell, an saves file in same folder as the original. E.G. Original File Name= Timesheet Cells B1= Location Cell C1 = Date in format 3-5-2004 Cell A1 = concatenate(B1,C1) Fle Name will therefore be "Timesheet Location 3-5-2004" The other problem is with the date. When concatenating, how do I forma the date to avoid it looking like "Location 38051" Any help much appreciated Nic -- Message posted from http://www.ExcelForum.com Hi for c...

Sync net folder problem
I am sharing my calendar to my workmate with net folder. My PC is Win XP and Office 2000 and my workmate's is Win 98 and also Office 2000. I always find that My calender can't be updated from my workmate when I return office after I've taken my notebook for a few days. Can't net folder sync. data offline? Thx. your attention. Ken So Net Folders uses e-mail messages to send updates between computers so naturally you would have to be connected to your e-mail to get any updates. When you leave the office and are not connected you won't get any updates but as soon as ...

How to use structured reference (ListColumns) in VBA
I want to do something simple...loop through a range retrieving values one at time and taking action on that value. This range is an Excel 2007 table column. Easy enough...BUT I want to use structured references to a table column by NAME, not numbers. I don't want to define new names, just use the table column headings. I've found ways of doing it with quotes, but that's not structured....the names in quotes do not change if the table heading is changed by the user. The formulas change if the table column heading is changed, but I want it to change in VBA to...

Printing Word and excel documents via excel vba
I have a document that has some Excel and some word content i would like to use excel vba to print both a page from word and then a page from excel. I know how to select and open the word document, however i cant find any code to print page X from word. basically i need to: print page 1 of c:\xx\document1.doc print page1 of sheet1 of c:\yy\excelwkbk1.xls print page 2 of c:\xx\document1.doc print page2 of sheet1 of c:\yy\excelwkbk1.xls and so on it will require moving between word and excel - the excel bit i get, but getting back to excel from word, and printing out in word is slightly more...

Can't Stop External Hard Drive
I have a Western Digital 250 gb external hard drive connected via USB port. I am also running Outlook 2007, which I believe has a function searchindexer.exe that searches all my drives to index the files on them. I want to be able to unplug the drive without first turning off my computer. But I get messages saying that the drive can't be stopped. It used to be that if I stopped searchindexer.exe, I could stop the drive. But that's stopped working. Here are two questions: 1. What is preventing me from stopping the drive?; 2. What is the worst that can happe...

Mounting exchange 2000 public folder store on exchange 2003
I have been told that this is not best practice we have gone ahead and done this we where having a great deal of difficulty getting the public folders to replicate. The public folder mail box was incorrectly named I used ADSIedit to change the mail box name in AD but this didn't work. So in the end we went for a dirty fix (users had lost access to public folders for one day already) and dismounted then copied the exchange 2000 public databases to the 2003 box and mounted them there with apparent success. I'm wondering if anyone has any experience with this? Can I expect this s...

I am using Outlook98 and all of a sudden, all the folders I have set up and been using over the past several years, have dissapeared. I believe the PST file is the same size, but the folders and their contents are nowhere to be found. How big is the .PST file? -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:1029601c3f42b$1ace3ac0$a101280a@phx.gbl, Kurt Wolfe wrote: > I am using Outlook98 and all of a sudden, all the folders > I have set up and been usi...

sharing folders in outlook
After setting up my outlook contact files to be shared via email, I sent a test email to myself asking if I wanted to accept the sharing utility. However on the email that was sent I am supposed to click on an 'accept' button to start sharing, however there is no 'accept' button present. There is a note that says if the button is not present I need to install the 'net folder component' however I have searched the microsoft site and cannot find any relevent installation advice. Does anyone have any ideas? What version of Outlook "Donna" <anonymous@di...

Copy Data from One Group of Cells to Another Group
I have five columns of data on two different sheets in the same workbook. One set of columns is sorted in ascending date order the other in descending date order. When I enter data into the last row of Sheet 1, I need the data in that row in columns A, B, C and D to be copied into Sheet 2 columns A, C, D and E in a newly inserted row 14. Is this possible with the use of a macro? I can find the last cell in Sheet 1, but then need to go up one row and back to column A. I am having difficulty with that. Thanks is advance for any assistance offered! /s/ Alan Auerbach On Sat, 26 May 2007, ...

red recovery drive folder
So I got a virus on my computer a month ago and I had a friend from geek squad come over and restart it with a recovery disk that Dell had sent me (I have a dell) after it was restored and the virus was gone my recovery folder was red and switched to my C: drive, and my os is now D: drive. When I asked him about the recovery drive being red he just told me that "its a good thing" but now when I go to download things for school onto my computer they wont stay, they download but stop right before its finished and I can't find it anywhere. I really need my computer properl...

Copy cell contents, then paste into the same cell with other text.
Hi! I tried a search first and couldn't find anything like this. My spreadsheet has a column for shipping that takes a series like this for each product: ?0.0*0.13.2*d*0x0x0:07:24:04 Following the question mark is the handling charge (0.0 in this example). This is followed by an * and then the weight of the item (0.13.2 in this example which is 13.2 ounces) I have a list of product weights in a colum with just pounds and ounces. I need to copy that information, then paste it into the weight area of the string above and then paste those modified contents back into t...

Registration Entry for External Data Refresh Prompt
Hello, I have several Excel Workbooks with external queries, pivots, etc. I have "ASK TO UPDATE AUTOMATIC LINKS" checked in TOOLS - OPTIONS. But it seems like I still stometimes get asked whether or not I want to update. Particularily I notice when I close the workbook I may get prompted if I want it to automatically update. Is there something I can do so I do not get prompted? Something in the registry perhaps? Thanks for any assistance! ...

simple syntax issue
I'v blind this morning to an error in the syntax of my code.. if somone would please take a look over my shoulder and redline the error... many thanks in advance, -mark Type = text PrintCatalogSheet = Yes/No BaseCatalogSheet = Yes/No CatalogSheetLink= Hyperlink PrintOrder = Number IsDetailSheet = Yes/No Dim sSQL As String sSQL = "INSERT INTO tbeAdditionalPages (Type, PrintCatalogSheet, BaseCatalogSheet, CatalogSheetLink, PrintOrder, IsMountingDetail) " & _ "VALUES (" _ & " ' " & ...

How to add series with VBA?
How can I add multiple series to an existing Excel graph using automation from Access 2000? I'm trying to set up a loop that will define the Xvalue and YValue for each series, but not sure how. I'm creating up to 100 Excel worksheets at a shot with data from Access 2000, and each worksheet needs to have a graph with multiple series. The worksheet creation loop looks like this: For i = 1 to sn.Count db.Execute "SELECT * INTO [Excel 8.0;Database=" & strXlsPath & "].[" & _ strSheetName & "] FROM tblExcelData", dbFailOnError Next Then ...

Task requests lacking "Accept" button
In Outlook 2003 (SP2, all updates) on my notebook, the task requests that I receive are lacking the clickable button to accept or reject them. If I poll the same task requests on my desktop machine, they do show the missing buttons. I tried scanpst.exe and a new profile, but in vain. Similar behavior of task requests was reported in this group repeatedly, recently in http://groups.google.de/group/microsoft.public.outlook/browse_thread/thread/5eafcfdd852be150/955da670ca93e396?hl=de&lnk=st&q=#955da670ca93e396 What can I do? Salut, Aristide On 7 Nov., 00:31, Aristide de la Tanne <a...

Simple? Help Needed with Excel Chart
Hi, I have an Excel document that lists events that happened according to its year. Each event is defined by a number from 1 to 10, which are listed on the Y axis. I am trying to create a chart that shows the events by year (in a line graph) so that the data points line up according to the year. I have set the years on the X axis. First, what I need is to show is that the years show up to scale (not equidistant). I think I've managed to figure this out by setting the date to be the same for each year (For example, 1/1/1985, 1/1/1989, etc). Is there a way to have the chart show ...

microsoft money loosing VAT content in split catogory withdrawl
Hi I have money 2000 and file VAT returns with the information it provides. I just discovered that if I have a split catogory withdrawl the VAT component is blank (greyed out) and is not in report. Can any one help with this problem thanks Gary ...

Error message
I cannot create a new folder on an external HDD. Win XP Pro, SP3. I go to My Computer, and select the external HDD letter. Then go over to the right-hand pane, right click and select New, then Folder. This produces an error message "Unable to create the folder 'New Folder' The file or directory is corrupted and unreadable." I can save and retrieve a Word document all right to this same external HDD. I can use the above method to create a new folder on the desktop, and on the two HDDs that are internal to the computer. Virus and malware scans are negati...