Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Directory Programming

0 views
Skip to first unread message

Jeff

unread,
Jan 15, 2004, 2:32:49 AM1/15/04
to
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

Pete McCosh

unread,
Jan 15, 2004, 3:56:56 AM1/15/04
to
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

0 new messages