+ Reply to Thread
Results 1 to 3 of 3

Open an excell file or text file or pdf from anywhere in the system

  1. #1
    Forum Contributor
    Join Date
    07-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    Open an excell file or text file or pdf from anywhere in the system

    Hai dear friends

    I have got a simple following macro to open an excel file by giving the entire path name in cell B4 ,if i change the path name ,the respective file name will open

    Please Login or Register  to view this content.
    in cell B4 I give like C:\TEST\User Report\LN167.xls

    here is there any way just to give any file name with out giving the entire path and not only excel but any kind of filename also in cell B4 and get it open
    for example in this case in cell B4 I give only LN167 or any other file name also like any pdf or any text or any picture file etc and get it open

    thank you very much
    Last edited by Leith Ross; 08-02-2013 at 04:07 PM. Reason: Added Code Tags

  2. #2
    Forum Contributor
    Join Date
    08-08-2005
    Location
    Kansas, USA
    MS-Off Ver
    2016
    Posts
    293

    Re: Open an excell file or text file or pdf from anywhere in the system

    No, you need to tell it the full path (unless it's always in the current directory.)

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Open an excell file or text file or pdf from anywhere in the system

    Hello catchnanan,

    With the exception of system files, any file that does not include a path is assumed to be in the current directory. It would not be practical to write a macro that would search the system to locate a file.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. [SOLVED] Open another Excell file
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-14-2012, 07:33 AM
  2. [SOLVED] open variably named file, copy/paste data into consolidation file, open next file in list
    By sllawrence1968 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2012, 09:49 PM
  3. [SOLVED] When I click on *.xls file, MS Excell open but file not. WhatToDo
    By Michael in forum Excel General
    Replies: 2
    Last Post: 03-20-2006, 11:50 AM
  4. [SOLVED] When I click on *.xls file, MS Excell open but file not. WhatToDo
    By Michael in forum Excel General
    Replies: 0
    Last Post: 02-17-2006, 06:40 AM
  5. [SOLVED] Excell 2000 - Cannot open file
    By RustyC in forum Excel General
    Replies: 2
    Last Post: 03-04-2005, 05:06 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