+ Reply to Thread
Results 1 to 3 of 3

Opening and saving a text file.

  1. #1
    Forum Contributor
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    107

    Question Opening and saving a text file.

    I am looking for a way to have an excel macro to grab a .txt file form on of my company's servers and save it with a new name in a different directory. Currently this file is updated every morning and always has the same name WCUSP.txt(it always opens with notepad). Every morning I go and open this file and save it to my department's local drive with todays date so that we have historical data. So today's file would be saved as WCUSP11062010.txt. This txt file is used in a query in another macro and right now I have to go out to the server and manually save the file. I would like my macro to grab this file and save it for me before running the rest of the macro.
    Last edited by CJPHX; 11-08-2010 at 02:55 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Opening and saving a text file.

    I'm no networking guru, so you'll have to play with the pathname references to get them right, but this is the syntax for copying a file from one place to another.

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    05-19-2010
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: Opening and saving a text file.

    Sorry for the long delay had some time off. Thank you JB that worked perfectly. I was busy trying to open the file and then save it again but your suggestion worked perfectly.

+ 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