+ Reply to Thread
Results 1 to 4 of 4

Code wont Run

  1. #1
    Registered User
    Join Date
    09-20-2006
    Posts
    47

    Code wont Run

    I have added this code into Excel and it seems to work but it does not actually do anything??

    Sub Auto_Update()

    With Application.FileSearch
    .NewSearch
    .LookIn = "M:\forecasts 2007\Forecasts 2007\MD"
    .Filename = "*.xls"
    If .Execute() > 0 Then
    For i = 1 To .FoundFiles.Count
    Workbooks.Open Filename:=.FoundFiles(i), UpdateLinks:=3
    ActiveWorkbook.Save
    ActiveWindow.Close
    'add your code in order to update links and to
    'close and save changes
    Next i
    End If
    End With

    End Sub


    Is there soemthing simple i am not doing??

    I want it to look for any .xls files in a certain area of my documents, then update the links, save them, then close and move onto the next file.

    I am very incompetent on VB so if you could help me i would really appreciate it.

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    Quote Originally Posted by test1986
    Is there soemthing simple i am not doing??
    Not that I can tell. This code works fine for me. Are you sure you have the folder structure right?

  3. #3
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723

    Code Wont Run

    HI
    try this it works for me

    Please Login or Register  to view this content.

    steve

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Code is working fine for me too ...
    check your files and directory ...

    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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