+ Reply to Thread
Results 1 to 3 of 3

Using GetOpenFilename

  1. #1
    Forum Contributor
    Join Date
    06-12-2007
    Posts
    144

    Using GetOpenFilename

    I have a macro where I use this to open a file:

    FName = Application.GetOpenFilename
    Later in the macro I need to activate the window of that file again (after activating another one) with this:

    Windows("im453.txt").Activate
    How can I use the FName variable to do it without hard coding the name?

    I think the problem is that the FName contains the full path, so how do I delete the left characters of FName up until the last "\" and call it FName2?

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

    It may be easier to create another variable and populate it when the workbook is opened.

    So if you use Fname when you open the required file, then immediately it is opened do something like

    Please Login or Register  to view this content.
    You can then use Fname2 to activate that workbook at some later time.

    HTH

    rylo

  3. #3
    Forum Contributor
    Join Date
    06-12-2007
    Posts
    144
    Brilliant, thank you so much

+ 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