+ Reply to Thread
Results 1 to 7 of 7

Open a text file from the desktop (Multiple users)

  1. #1
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Open a text file from the desktop (Multiple users)

    Hi there, does anyone know any code for opening a text file(.txt) from the desktop so that multiple users can open the text file (Our IT dept is restricting some peoples access to their C/ drive) from a macro.
    Ideally I would like to put the text file in a folder on the desktop first.
    Any suggestions welcome

  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
    48,948

    Re: Open a text file from the desktop (Multiple users)

    The desktop is just a folder:

    C:\Users\... user name ...\Desktop

    Regards
    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
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: Open a text file from the desktop (Multiple users)

    The username is the problem. There are various macro's that we use that are used by as many as 10 different users. Obviously we want to avoid if possible creating/copying and amending 10 different macro's each time if at all if possible.
    I believe we can't just put in C:\.Desktop\"TEXT FILE NAME".txt or something similar like we can in the C:\ drive.
    Please let me know if I am mistaken

  4. #4
    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
    48,948

    Re: Open a text file from the desktop (Multiple users)

    The desktop is unique to the user. That said, the "All Users" shared area also has a desktop.

    You could try putting the files there: C:\Users\All Users\Desktop

    How are you planning on distributing these files?

    Regards

  5. #5
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: Open a text file from the desktop (Multiple users)

    The text files are created by the user from the companies mainframe which is based on "Reflection" and so they print to the desktop and are not the problem. The problem is any new macro we use needs to be able to access these files. One of us writes and e-mails out the macro's to the others.

  6. #6
    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
    48,948

    Re: Open a text file from the desktop (Multiple users)

    There are various functions to get the user's Windows Logon ID and their "application name".

    Google Excel VBA Get User Name

    One example:

    http://www.exceltip.com/st/Function_...Excel/452.html

    Regards

  7. #7
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: Open a text file from the desktop (Multiple users)

    Getting the username isn't the problem as they are std across the group.
    The problem is getting a generic path to go in the macro, but before we go any further I will try to get into the all users folder on one of the restricted peoples logins tomorrow and see what happens, but I suspect that they won't gain access as I know can't put anything new in the main C drive folder but we'll see.what happens

+ 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