Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Move File

I have tried the code, and I cannot get the same error. This is the code I
used:
Sub test()
Application.EnableEvents = False
Application.ScreenUpdating = False
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
PathOld = "c:\old\" 'Change as needed
Path = "c:\new" ''Change as needed
Filename = Dir(Path & "\*.xls", vbNormal)
Do Until Filename = ""
Set Wkb2 = Workbooks.Open(Filename:=Path & "\" & Filename)
For Each WS In Wkb2.Worksheets
WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Cou nt)
Next WS
Wkb2.Close False
fso.MoveFile Path & "\" & Filename, PathOld
Filename = Dir()
Loop
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

Miguel.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Move excel file to desk top? Nina Excel Discussion (Misc queries) 1 March 16th 06 12:27 AM
Excel Outlook Attachments opening after several errors everytime cito_support Setting up and Configuration of Excel 2 March 13th 06 06:15 PM
Hyperlinks - Move file to local drive, all links break Shawn McGowen Excel Discussion (Misc queries) 1 March 9th 06 12:52 AM
Links picking up values from an older version of linked file Cate Links and Linking in Excel 4 October 20th 05 01:53 PM
How do you open a template at startup? James Kendall Excel Discussion (Misc queries) 7 July 26th 05 07:33 PM


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"