+ Reply to Thread
Results 1 to 3 of 3

Macro wioill not select folder and File

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,722

    Macro wioill not select folder and File

    When I use a macro in a certain workbook to select a file in a particular folder to open and to copy the data and save the file one macro has run and then activate a macro in another workbook to open up a file in a another folder, it defaults to the previous folder and shows the previous file in the dialog box


    It would be appreciated if someone could amend my code to select Folder C:\extract and file starting with EWhs




    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Macro wioill not select folder and File

    Set the InitialFileName property. This must have a trailing '\' to indicate it is a directory rather than a file.
    Please Login or Register  to view this content.
    Edit: That'll just set the initial directory, you can also add a file mask to further limit the files displayed:
    Please Login or Register  to view this content.
    Last edited by cytop; 06-11-2022 at 09:00 AM.

  3. #3
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,722

    Re: Macro wioill not select folder and File

    Thanks for the help and advise Cytop. This is much appreciated

+ 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] Macro to select File within Folder
    By Howardc1001 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-29-2021, 12:02 AM
  2. Vba save csv file but ask for file name or select file name from folder
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2017, 12:30 AM
  3. [SOLVED] How to select a file instead of selecting the file's destination path/folder
    By dedark05 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2016, 10:17 PM
  4. Replies: 0
    Last Post: 11-20-2014, 03:18 AM
  5. Select a file or folder
    By yossel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-30-2014, 06:17 PM
  6. [SOLVED] Modify existing code to select file instead of select folder
    By Gti182 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2014, 09:41 AM
  7. Macro asking to select the folder and open file.
    By lalaarif1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-04-2013, 04:03 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