Results 1 to 7 of 7

Referencing a closed workbook

Threaded View

  1. #4
    Forum Contributor
    Join Date
    07-25-2012
    Location
    Winterville, NC
    MS-Off Ver
    365 V2504 (16.0.18730)
    Posts
    144

    Re: Referencing a closed workbook

    The time it takes will just depend on how big your files are and how many you have to open/close. Below is my macro recommendation. MY DISCLAIMER: This is really general code...without knowing the details of your files, I'm just giving some basics.

    (Open Developer, Use the "This Workbook" Excel Object)

    Private Sub Workbook_Open()
        Application.ScreenUpdating = False   'This turns off screen updating and speeds up macro
        Workbooks.Open Filename:="L:\Folder\Filename.xlsx"    'Opens the file (rinse)
        ActiveWorkbook.UpdateLink Name:= _
            "L:\Folder\Filename.xlsx", _
            Type:=xlExcelLinks    'Updates links (lather)
        Workbooks.Close Filename:="L:\Folder\Filename.xlsx"    'Close the file (repeat)
        '*********************
        'Copy paste the rinse/lather/repeat sections ;) here and change the file names for each file you have to open. (delete this line)
        '*********************   
        Application.ScreenUpdating = True    'This turns screen updating back on
    End Sub
    As for this:
    Can I set the macro so that it occurs when a cell or cells are changed?
    Do you mean when you change cells in the main data sources?



    If you found this post to be helpful, or if it at least brought a smile to your face, please say "Thank You" by clicking Add Reputation. Thank you!
    Last edited by acroley1; 05-25-2015 at 02:42 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sumifs used referencing a closed workbook
    By kgallo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2015, 06:57 PM
  2. [SOLVED] Trouble copying data from closed workbook into active workbook, referencing help
    By lepperga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2013, 01:48 PM
  3. [SOLVED] Referencing a closed workbook
    By RowanB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2012, 05:13 AM
  4. UDF referencing closed workbook not working
    By davegugg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-25-2010, 09:17 PM
  5. referencing a named range from a closed workbook
    By Gixxer_J_97 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-08-2005, 04:06 PM

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