+ Reply to Thread
Results 1 to 2 of 2

Open excel files in a folder

  1. #1
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    44

    Open excel files in a folder

    Hi, Am trying to open excel files in a folder with code below.

    Please Login or Register  to view this content.
    What does the code
    Please Login or Register  to view this content.
    do before loop? Does it increment to next file. Because earlier without this line, it kept opening the same file.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Open excel files in a folder

    Quote Originally Posted by aavins73 View Post
    Does it increment to next file.
    That's exactly what it does.

    In the VBA editor, highlight the Dir term and press F1 for help. This is from the helpfile.

    Dir returns the first file name that matches pathname. To get any additional file names that match pathname, call Dir again with no arguments. When no more file names match, Dir returns a zero-length string (""). Once a zero-length string is returned, you must specify pathname in subsequent calls or an error occurs.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel VBA code for selecting a folder then search & open specified files in that folder
    By Excelrookie_1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2021, 03:09 AM
  2. one folder & so many excel files are save, i want name change without open excel files
    By sonu_kumar444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2013, 03:45 PM
  3. [SOLVED] Open excel files from a folder
    By mmmarks in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2012, 10:37 AM
  4. [SOLVED] Open all files in a SharePoint folder (Problem: Files open out of order)
    By holmstarrunner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2012, 10:13 AM
  5. Can't open Excel files from folder
    By Mark in forum Excel General
    Replies: 2
    Last Post: 03-17-2006, 10:10 AM

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