View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Berglund[_2_] Jim Berglund[_2_] is offline
external usenet poster
 
Posts: 86
Default Opening Files on other User's Desktops

I tried this and got the string for the UserName. Thanks,

My users won't be able to do this - in fact, I don't want them touching the
code. Is there any way I can make this work in a generic way? I've tried all
the suggestions so far, without success.

Jim

"Gary Keramidas" wrote in message
...
use environ("userprofile") to determine the location.

in the vb editor. do a control g to enable the immediate window

paste the following and hit enter

?Environ("UserProfile") & "\Desktop\"

it should give you the desktop location on any pc. then, just add the
filenames, i have no idea if they're hard coded, in cells or what.

--


Gary Keramidas
Excel 2003


"Jim Berglund" wrote in message
...
I may have made an error in judgment by asking this question again, but
having played around with it, I can state the concern properly...

I have created a worksheet which has to run on various user's PC's. It
takes two Do Not Call List area code files, joins them, reformats the
data and then determines if any if the data is also found in data from a
reverse telephone directory, and creates a list of numbers that can be
called.

The three data files used are downloaded from the Internet, onto the
user's Desktop. My Excel spreadsheet needs to open the files. The users
typically have Windows 7 or Vista.

I've been told that I can access these files with
Workbooks.Open Filename:="..\Desktop\XXX.csv"

This works on Windows 7 machines, but not on Vista - the only difference
in the software used.

Is there a simple way to fix this?

Jim Berglund