Results 1 to 3 of 3

Thread: Does Not Update

  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Does Not Update

    I have a workbook (Excel2K-SR1) that is opened via batch file. When opened, it is supposed to automatically refresh all external links, save as a space-delimited text file, and then close Excel. I tried to keep things simple, using the macro record button to capture the code needed to run Edit | Links | Update Now, and then pasted the code into my workbook -- but it would continuously error out. It would run on its own, but I could not get it integrated into the existing code.) Below is the only code that I could get to work, but today it opened the workbook, did NOT refresh any links, and then saved old data out to the text file.

    <pre>Private Sub Workbook_Open()
    Application.DisplayAlerts = False
    ActiveWorkbook.RefreshAll 'Needs to update all links HERE
    ActiveWorkbook.SaveAs Filename:= _
    "C:Program FilesIBMClient AccessEmulatorprivateAutoRpt.prn", FileFormat _
    :=xlTextPrinter, CreateBackup:=False
    Application.Quit
    End Sub
    </pre>


    This is really getting frustrating! <img src=/S/scream.gif border=0 alt=scream width=15 height=15> What is needed to get links set to update automatically TO update automatically in this workbook??? <img src=/S/help.gif border=0 alt=help width=23 height=15>

  2. #2
    Lounger
    Join Date
    Apr 2001
    Location
    Michigan, USA
    Posts
    26
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Does Not Update

    Just a shot in the dark, but you might try:

    ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources

    and:

    Application.Calculate

    HTH

    Mark

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Does Not Update

    Thanks. I was finally able to get the code put in place this morning and tested it out, using "CalculateFull" instead of just "Calculate", and the whole workbook did exactly as it was intended to do. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

Posting Permissions

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