+ Reply to Thread
Results 1 to 3 of 3

Why can't I set a value

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Why can't I set a value

    I found the following piece of code, I think in this forum, and have used it to help find and open files from within Excel.
    Please Login or Register  to view this content.
    This time, however, I have a problem. When I was first setting up the code I uploaded a standard file from my local disc. The variable FilepathName was given the value of "C:\Users\John\Documents\".
    When this was successful the variable FilePathName was set to "U:\Everybody\LabelOrders\Vista\". as needed when the application is used inearnest. The routine still worked but persisted with opening up at the first FilePath.
    Watching the code execute showed that at the line marked ****** that fdl.InitialFileName persisted with old value of FilePathName and did not seem to follow the instruction in the code line. This persisted even after I had closed and reopened Excel.
    The application is itself filed in C:\Users\John\Documents.
    How can I ensure that fdl. InitialFileName is filled with the file path I want?
    Johnm

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Why can't I set a value

    Are you sure that the path U:\Everybody\LabelOrders\Vista\ exists? Did you type it manually or copied from the explorer window's address bar? Try to navigate to this path in windows explorer and copy the path from the explorer itself, maybe this is misspelled.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Why can't I set a value

    I think you may have to first change the drive before .InitialFileName.

    Please Login or Register  to view this content.
    Or just this...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 11-11-2015 at 12:43 PM. Reason: removed = sign
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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