+ Reply to Thread
Results 1 to 5 of 5

Macro to open a folder containing documents

  1. #1
    Registered User
    Join Date
    06-19-2012
    Location
    Liverpool
    MS-Off Ver
    Excel 2007
    Posts
    19

    Macro to open a folder containing documents

    Hi ppl,

    I am trying to create a macro that opens a folder which contains varous types of documents and then be able to select any of the documents and have it open in its corresponding application.

    An example of the folder I want to direct the user to and then the file types in the folder:

    TestFolder
    Word Doc1
    Word Doc1
    Excel Doc1
    powerpoint doc1
    MS project plan1

    I have got the code so it opens the folder and it sucessfully opens excel documents but if i try and open any other doc type it just opens a blank workbook.

    the code I'm using is as follows:

    Please Login or Register  to view this content.
    I'm guessing it has something to do with the final line 'Workbooks.Open Filename' which looks like it is telling it to open the document in workbook format but I'm not sure how to resolve.

    Can someone help.

    Mnay thanks
    Last edited by arlu1201; 09-06-2012 at 08:31 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Macro to open a folder containing documents

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: Macro to open a folder containing documents

    change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-19-2012
    Location
    Liverpool
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Macro to open a folder containing documents

    excellent, thanks for your help and quick reply.

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macro to open a folder containing documents

    to open doc files
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

+ 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