+ Reply to Thread
Results 1 to 5 of 5

pass the file name written in a cell to the file path

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    pass the file name written in a cell to the file path

    Hi all,

    I found some code that will read the content of an outlook email. The idea would be to use this code to read the selected email. For now the path to the email is hard coded.
    How could I pass the cell value to the path? (should be the current selected cell)
    Please Login or Register  to view this content.
    Thanks in advance.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,467

    Re: pass the file name written in a cell to the file path

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: pass the file name written in a cell to the file path

    Hi TMS,

    Thanks for the code. I actually don't have the full path of the file in the cell (I should have been more specific).
    I now made some changes to refer to both differently. please see below:

    Please Login or Register  to view this content.
    I just can't figure out to get the MyPath and MyMsg working together.
    Any idea where I go wrong?

    Greetings.

  4. #4
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: pass the file name written in a cell to the file path

    You must try removing the quotes as these are variables.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: pass the file name written in a cell to the file path

    Hi Jayesh25,

    That worked out :-)
    I have no clue why I did not came up with that, just did not expect it to be so simple.

    Many, many thanks.

    Greetings.

+ 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. Replies: 0
    Last Post: 05-08-2014, 11:42 AM
  2. Replies: 3
    Last Post: 05-21-2013, 08:22 AM
  3. Replies: 5
    Last Post: 03-21-2013, 07:34 AM
  4. [SOLVED] Get file path from a cell, run a check to see if the file has a specific sheet if yes copy
    By Martha44 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2013, 03:35 AM
  5. Replies: 0
    Last Post: 01-27-2013, 12:13 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