Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Identifying the user's drive letter

In all my macros the file references assume that the file structure resides
under the c drive. If I want to distribute these macros what technique do I
need to use so that they can be used by other people who may be on a network
and whose drive letter is unknown to me.
Thank you in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Identifying the user's drive letter

If they have several drives mapped, how would you know which is their file
drive.

I would add some code that prompts for the user to supply the letter, on
workbook open. Save the value somewhere, a hidden worksheet say, and then
you can check if a value is there, and not prompt again.

Also, think about an option to let them change it.

Either that, or assume nothing, and use GrtOpenFilename to let them pick the
file to open.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ben" wrote in message
...
In all my macros the file references assume that the file structure

resides
under the c drive. If I want to distribute these macros what technique do

I
need to use so that they can be used by other people who may be on a

network
and whose drive letter is unknown to me.
Thank you in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Identifying the user's drive letter

CurDir will tell you the directory they are in now. From that you can
extract the drive letter.

Mike F
"Ben" wrote in message
...
In all my macros the file references assume that the file structure
resides
under the c drive. If I want to distribute these macros what technique do
I
need to use so that they can be used by other people who may be on a
network
and whose drive letter is unknown to me.
Thank you in advance



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Identifying the user's drive letter

You must know something about the folder structure.

If you don't, just ask the user to locate the file.

If you do, make some guesses. If they fail, ask the user.

Possible guesses:
check c:\,
identify the drive in curdir
check the drive of the file with the code -- an add-in, I hope
check the drive of the open data file
check the drive of the system folder -- environ("systemroot")

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
In all my macros the file references assume that the file structure resides
under the c drive. If I want to distribute these macros what technique do I
need to use so that they can be used by other people who may be on a network
and whose drive letter is unknown to me.
Thank you in advance

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
Obtain drive letter assignment of CD/DVD drive? EagleOne Excel Discussion (Misc queries) 1 October 13th 06 01:27 PM
Detecting the drive letter of a user's CD Charles Jordan Excel Programming 4 September 24th 04 06:08 AM
Help to Indentify a drive letter Grandad Excel Programming 12 August 6th 04 08:50 PM
Using path instead of drive letter dumbass Excel Programming 2 May 25th 04 12:25 AM
How to find the drive letter? Mervyn Thomas Excel Programming 8 January 31st 04 01:11 PM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"