Getopenfilename Default File Path On Word

Getopenfilename Default File Path On Word Average ratng: 3,6/5 1195 votes

I've had success opening files in several different manners via macros from your posts, Thank You. I'm stumped with one particular code that I found in a different site, that opens a dialog box so you can choose to open an Excel file of your choosing. For some reason, the dialog box opens at the directory location that I had previously 'visited'. I would like to add a line of code that points to a specific location at all times (that is, a specific path), but I just can't get it to work successfully. Here's my code.

Re: Allow Users To Choose File To Open. Default To Specific Path/Directory Oh, boy, Dave.this is fantastic. I really like the simple code you provided.

This method will return a string value specifying the path and filename that was selected. SFullPath = Application. FilterIndex - This specifies which file filter is the default. Not required if. Does not exist. Another way to word this question would be: How do I set the value returned by CurDir to a network path? I'm working with VBA in Excel 2000. Next, you use the Application.GetOpenFilename to select the file.

This really helps me as I'm trying to learn VBA. Just one note for others that might experience some problems with this code: I was having problems getting this to change directories. I was trying to go from my C drive to a network drive (M, in this case) and at first the macro kept opening up in my C drive although I had changed the C to an M. I fiddled around in explorer to see if the IP address was needed in the code. After a few unsuccessful tries, I just used the ChDir to 'M: ' and that finally worked. I'm not sure what was going on, but I can now specify the specific path in the network drive.

Thank you very much! Much appreciated!

Getopenfilename Default File Path On Word

Re: Allow Users To Choose File To Open. Default To Specific Path/Directory Posting your question in threads started by others is a violation of the Forum Rules and is known as thread hijacking. Download leon schuster videos youtube. Posting solutions is acceptable. ALWAYS start a new thread for your questions. You may, if you find it helpful, provide a link back to this (or any other) thread. Start a new thread and be sure to give it a title using only search friendly key words that accurately describe your thread content or overall objective and avoid the use of non-essential words such as 'I need', 'Help', 'urgent', 'desperate', etc.