+ Reply to Thread
Results 1 to 2 of 2

Macro to use data from closed excel

  1. #1
    Registered User
    Join Date
    08-03-2018
    Location
    Chennai
    MS-Off Ver
    na
    Posts
    1

    Macro to use data from closed excel

    Hi All,
    So I have a file 'A' which has two sheets 'a' and 'b'. I run a macro from Sheet 'a' which uses the data in sheet 'b'. Since both the sheets in the same file is increasing the file size by a lot ,I want to take out the sheet 'b' from File A and put it in the same folder as file 'A' in a separate file 'B'. I want to know how can I edit the macro to use the same sheet but from a closed file instead of in the same file.
    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    How do I define the worksheet b when it is not in the same file and also will it work if the Macro is run when the File B is not open?

    Thanks in Advance,
    Aurka
    Last edited by 6StringJazzer; 08-03-2018 at 10:08 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,674

    Re: Macro to use data from closed excel

    There is a way for VBA to work on a file that is not open, but it is not straightforward. I strongly recommend that your code open the file then close when it's finished.

    Please Login or Register  to view this content.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro for automatically refreshing Data connection on Closed excel workbook.
    By Ramzan-ul-Mubarak in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-23-2017, 01:23 PM
  2. Export data with two Criteria values from closed workbook to closed workbooks VBA
    By julielara in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2016, 01:56 PM
  3. Excel Macro Copy Alph Numberic Data from a Closed CSV File to an Active Excel WorkBook
    By sanjaydutta20022 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2016, 10:33 PM
  4. Copying data from a closed workbook with macro
    By tpollard1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-07-2016, 01:26 PM
  5. [SOLVED] Macro Help - Copy Data From Closed File
    By Belthasar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2013, 05:21 AM
  6. Retrieiving data from a closed excel file using a macro
    By sherry_1991 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2012, 05:37 AM
  7. Auto run macro when Excel is closed
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2011, 11:14 AM

Tags for this Thread

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