Results 1 to 2 of 2

Thread: AutoOpen Macro

  1. #1

    AutoOpen Macro

    I am using a lookup command from one XL worksheet to another sheet. The source sheet has more than 18,000 records and XL delivers a memory error on all links to files with excess of 17,000 records. One way around this is to open the source files before opening the sheet referencing the source file. How can I create a macro to run when the dependent file is opened to open the source file before finally opening the dependent file? (I hope that makes sense)

  2. #2
    Star Lounger
    Join Date
    Jan 2001
    Adelaide, South Australia
    Thanked 0 Times in 0 Posts

    Re: AutoOpen Macro

    Something along the lines of the following should do the trick:

    Sub auto_open()
    Application.Calculation = xlCalculationManual 'Turn off automatic calculation
    Workbooks.Open ThisWorkbook.Path & "book3.xls"
    Application.Calculate 'calculate all the links
    End Sub

    The only thing I'm not sure about is when Excel will try to recalculate the links. In order to make certain that things stay healthy, it might be an idea to turn off automatic recalculation before you open the first workbook.


Posting Permissions

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