I would like the search window to use a default filepath that is the filepath where the active workbook is stored.
Getopenfilename Default File Path On License For ThisI programmed this once before using a Common Dialog control, but I dont appear to have a license for this control at my new workplace.Is there a concise way to extract the drive of the active workbook without doing the following.
For some reason, you actually have to specify the drive before you specifiy the filepath (even though the filepath contains the directory: ) I did not get an error on the (S) line of my code... I just put it in there for testing purposes. The workbook can be stored in any drive or directory, and will not always be in the S drive. By continuing to browse this site, you are agreeing to our use of cookies. I want to use Application.GetOpenFilename in Excel VBA to open a file and I want it to open in the same directory as ThisWorkbook.Path. I have found that beforehand I can do. But, I want it to revert back to the default directory (no matter what that was). On my computer, which is Windows XP, it happens to be MyDocuments. Getopenfilename Default File Path On How To Figure OutI cant find anywhere how to figure out what the original default directory was so that I can store this so that I can later reset back to the default. Alternatively you can also use the SetCurrentDirectory API too:). This is what I found in a forum, its working surprisingly well. Provide details and share your research But avoid Asking for help, clarification, or responding to other answers. Making statements based on opinion; back them up with references or personal experience. Not the answer youre looking for Browse other questions tagged excel excel-2007 vba or ask your own question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |