+ Reply to Thread
Results 1 to 4 of 4

open textfile from path defined by environment variable

  1. #1
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    open textfile from path defined by environment variable

    I found this code and maybe I'm almost there. I need to get the value of the Environment variable called HOME if it exists.

    These macros collect all the environemnt variabes into an array and then show them in a messabe box.

    Please Login or Register  to view this content.

    In my workbook, I want to open a textfile from the path defined by the HOME environment variable if it exists. If the file does not exist, do not allow an error for the user. the textfile is always called ocean_def.txt

    Please Login or Register  to view this content.
    Last edited by proepert; 02-15-2010 at 12:23 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,662

    Re: open textfile from path defined by environment variable

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: open textfile from path defined by environment variable

    Hi

    Here's one way to get the file string. If the string length is 0, then you don't progress. If it is >0 then you have a filename to action.

    Please Login or Register  to view this content.
    rylo

  4. #4
    Forum Contributor
    Join Date
    11-17-2009
    Location
    PA USA
    MS-Off Ver
    Excel 2000
    Posts
    184

    Re: open textfile from path defined by environment variable

    Thank you.

+ 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