![]() |
Set the path
My subroutines open up a lot of files with very specific names. I will be
careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace |
Set the path
http://j-walk.com/ss/excel/tips/tip29.htm
Selecting a Directory -- Regards, Tom Ogilvy "Grace" wrote in message ... My subroutines open up a lot of files with very specific names. I will be careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace |
Set the path
OK, I went there. At the bottom, it says:
NOTE: If you use Excel 2002 you can prompt the user to select a directory by using the new FileDialog object. The advantage is that you can specify a starting directory. Does this mean that with newer versions of EXCEL (2002 and newer), there is a much easier way? His way looks quite complex. Also, if there is not a much easier way, I note that that site says Specifying the starting directory If you would like to be able to specify the starting directory, things get a lot more complicated. a.. Download Jim Rech's BrowseForFolder example But that link is no longer working. Also, I am confused about what the first macro does. Does it just tell you what the current directory is, but doesn't allow you to "specify" the one you want? If so, and if the bottom link doesn't work, I am still out of luck. Help, anyone! Grace "Tom Ogilvy" wrote in message ... http://j-walk.com/ss/excel/tips/tip29.htm Selecting a Directory -- Regards, Tom Ogilvy "Grace" wrote in message ... My subroutines open up a lot of files with very specific names. I will be careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace |
Set the path
It allows you to choose the folder - just like you asked.
There is no reason that I can see to set a starting directory as you described you problem. You want to select a directory and it allows you do to that. the link at the bottom would be started as http://www.bmslt.ie but as I said, you don't need to specify a starting directory. there is a new object called filedialog in excel 2002 and later, but then anyone using the code would need to have xl2002 or later. the code isn't complex since it already has been written and all you need to do is paste it into a new module. How complex is that? -- Regards, Tom Ogilvy "Grace" wrote in message ... OK, I went there. At the bottom, it says: NOTE: If you use Excel 2002 you can prompt the user to select a directory by using the new FileDialog object. The advantage is that you can specify a starting directory. Does this mean that with newer versions of EXCEL (2002 and newer), there is a much easier way? His way looks quite complex. Also, if there is not a much easier way, I note that that site says Specifying the starting directory If you would like to be able to specify the starting directory, things get a lot more complicated. Download Jim Rech's BrowseForFolder example But that link is no longer working. Also, I am confused about what the first macro does. Does it just tell you what the current directory is, but doesn't allow you to "specify" the one you want? If so, and if the bottom link doesn't work, I am still out of luck. Help, anyone! Grace "Tom Ogilvy" wrote in message ... http://j-walk.com/ss/excel/tips/tip29.htm Selecting a Directory -- Regards, Tom Ogilvy "Grace" wrote in message ... My subroutines open up a lot of files with very specific names. I will be careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace |
Set the path
Yes, it is. Thanks.
"Tom Ogilvy" wrote in message ... It allows you to choose the folder - just like you asked. There is no reason that I can see to set a starting directory as you described you problem. You want to select a directory and it allows you do to that. the link at the bottom would be started as http://www.bmslt.ie but as I said, you don't need to specify a starting directory. there is a new object called filedialog in excel 2002 and later, but then anyone using the code would need to have xl2002 or later. the code isn't complex since it already has been written and all you need to do is paste it into a new module. How complex is that? -- Regards, Tom Ogilvy "Grace" wrote in message ... OK, I went there. At the bottom, it says: NOTE: If you use Excel 2002 you can prompt the user to select a directory by using the new FileDialog object. The advantage is that you can specify a starting directory. Does this mean that with newer versions of EXCEL (2002 and newer), there is a much easier way? His way looks quite complex. Also, if there is not a much easier way, I note that that site says Specifying the starting directory If you would like to be able to specify the starting directory, things get a lot more complicated. Download Jim Rech's BrowseForFolder example But that link is no longer working. Also, I am confused about what the first macro does. Does it just tell you what the current directory is, but doesn't allow you to "specify" the one you want? If so, and if the bottom link doesn't work, I am still out of luck. Help, anyone! Grace "Tom Ogilvy" wrote in message ... http://j-walk.com/ss/excel/tips/tip29.htm Selecting a Directory -- Regards, Tom Ogilvy "Grace" wrote in message ... My subroutines open up a lot of files with very specific names. I will be careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace |
Set the path
Tools Options General
Default File Location -----Original Message----- My subroutines open up a lot of files with very specific names. I will be careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace . |
Set the path
Unless I'm wrong, if I save the file, this stays as the default path for
every new file I might open. I do NOT want to change my default path, just to assign one for the current file for the moment. But Tom already gave me an answer, so I'm Ok now. Thx, G "Mark" wrote in message ... Tools Options General Default File Location -----Original Message----- My subroutines open up a lot of files with very specific names. I will be careful to give those files the right names before starting the macro. One thing I'm having trouble with is telling it the right path and folder to look in. Though I could try to automate the pathname too, I am starting to think that it would be just best to have the macro let me browse to the folder, WITHOUT even opening a file. can someone suggest some VBA code to have it let me browse to a folder and then set that folder as the default place to look for any files I am to LATER open, even the very first one. Thanks, Grace . |
All times are GMT +1. The time now is 01:36 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com