Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Directory Programming
Hello,
I have been asked to develop an Excel project, and need some help. I've listed the specs below * I am running Excel/Office xp/2002 on my machine, however, I have to save the excel file back to excel 95 format * My brief is to...."re-develop code to work from current directory and not physcial directory". Currently, examples of the vb code in place in macro's is.... ChDrive "C" ChDir "C:\Applications\ApplA1\Data" ChDrive "C" ChDir "C:\Applications\ApplA2\Billing" BUT, once i've finished re-developing it, and handover, mary may take the files and install on, say g:\currentwork\applications. Fred could install it on his machine on y:\officefiles\applications. I just dont know where each user will install it on their pc. Many users = hundreds of possible locations What I need, is to replace the two lines of code above, so that it picks up on a)which drive the files are stored on. The user will open a main xls file first, which they will locate on whatever directory on their hard drive its on by browsing in windows explorer, or a desktop icon, and double clicking, so the main file will be opened from it's location on the hard drive, and b)so that it "logs" to the correct directory. I cant "hard code" in chdir to marys g:\currentwork directory, or freds y:\officefiles, as I simply wont know which directory each user installs to Thankyou in advance, remembering, I open the files in excel 2002, but HAVE to save back to excel 95 format Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Directory Programming
Jeff,
ThisWorkbook.Path will get you a string containing the file path to the folder containing your file. Whether this will work in Excel 95, I have absolutely no idea. Cheers, Pete -----Original Message----- Hello, I have been asked to develop an Excel project, and need some help. I've listed the specs below * I am running Excel/Office xp/2002 on my machine, however, I have to save the excel file back to excel 95 format * My brief is to...."re-develop code to work from current directory and not physcial directory". Currently, examples of the vb code in place in macro's is.... ChDrive "C" ChDir "C:\Applications\ApplA1\Data" ChDrive "C" ChDir "C:\Applications\ApplA2\Billing" BUT, once i've finished re-developing it, and handover, mary may take the files and install on, say g:\currentwork\applications. Fred could install it on his machine on y:\officefiles\applications. I just dont know where each user will install it on their pc. Many users = hundreds of possible locations What I need, is to replace the two lines of code above, so that it picks up on a)which drive the files are stored on. The user will open a main xls file first, which they will locate on whatever directory on their hard drive its on by browsing in windows explorer, or a desktop icon, and double clicking, so the main file will be opened from it's location on the hard drive, and b)so that it "logs" to the correct directory. I cant "hard code" in chdir to marys g:\currentwork directory, or freds y:\officefiles, as I simply wont know which directory each user installs to Thankyou in advance, remembering, I open the files in excel 2002, but HAVE to save back to excel 95 format Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA Programming | New Users to Excel | |||
Programming help | Excel Programming | |||
Help in VBA programming | Excel Programming | |||
Check if directory empty OR no of files in directory. | Excel Programming | |||
Do I need programming for this? | Excel Programming |