+ Reply to Thread
Results 1 to 6 of 6

Open file and run macro based on partial file name

  1. #1
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Open file and run macro based on partial file name

    So I have the following code that should open a workbook and run a macro then close it, but obviously it doesn't work. Anyone has any ideas how to make it work? I added 2 new lines believing that I need to return the name a string, but it doesn't work either.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Click the * to say thanks.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Open file and run macro based on partial file name

    Try
    Please Login or Register  to view this content.

  3. #3
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Open file and run macro based on partial file name

    Thank you fluffy, that indeed, solved my problem. But now I get an runtime-error 13 on this line:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Open file and run macro based on partial file name

    That should just be
    Please Login or Register  to view this content.

  5. #5
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: Open file and run macro based on partial file name

    Oh, cause we've already declared it. thank your for your solution

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: Open file and run macro based on partial file name

    You're welcome & thanks for the feedback

+ 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. Attach File to Outlook Based on Partial Criteria file name
    By brianfu777 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2019, 05:13 AM
  2. Replies: 27
    Last Post: 06-15-2016, 01:05 PM
  3. [SOLVED] Macro to open a file when only a partial name is known
    By hbender in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-19-2015, 10:20 AM
  4. Need Macro file to split then consolidate workbooks based on partial file name
    By dawnmau in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2014, 04:37 PM
  5. Find, open and work with file based on partial name
    By nteil in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-31-2013, 09:37 AM
  6. [SOLVED] Assigning Variable Based on Partial Name of an Open File
    By lsteinbach in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2013, 05:28 PM
  7. Lookup & open file based on partial filename
    By Im2bz2p345 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2011, 07:04 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