+ Reply to Thread
Results 1 to 2 of 2

How to open a workbook with partial Name?

  1. #1
    Registered User
    Join Date
    03-05-2008
    Posts
    23

    How to open a workbook with partial Name?

    Hi all,

    I need a help from you.In VBA how to open a workbook for which i know only the partial name?
    E.x April_2008.xls .How to open this workbook with the parital Name "April"?

    Thanks in advance.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello ananthakumar.e,

    Since you can't open a workbook without knowing its full name, you would need to search a directory for all files that match "April" and then manually select the file you want to open. There is no built in file function to filter file names using wild card characters. The easiest approach is display the directory using Application.GetOpenDialog and search for the file you want. Creating all the VBA routines to do the filtering, constructing a user interface, and selecting the file is probably not worth your time in the end.

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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