Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Programming [email protected] New Users to Excel 2 May 28th 08 08:38 PM
Programming help Me Excel Programming 13 December 26th 03 08:18 PM
Help in VBA programming padmaja[_2_] Excel Programming 2 December 23rd 03 09:59 AM
Check if directory empty OR no of files in directory. Michael Beckinsale Excel Programming 2 December 4th 03 10:12 PM
Do I need programming for this? .NET Developer Excel Programming 2 August 18th 03 08:55 PM


All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"