View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steve Smallman Steve Smallman is offline
external usenet poster
 
Posts: 47
Default Need new idea for universal path

Alternatively,

set permissions for the users to be able to run the workbook on the server.

I assume your report workbook has been structured so that they cannot write
back to the database, so let them have access to the workbook...... perhaps?

Steve
"Henry" wrote in message
...
Tod,

What you appear to want is to set up a different path for each user.
Here's a (very) rough idea of how to do that.

If Application.Username ="Todd" then
MyPath = "your path"
Else
MyPath = "others path"
End If
[If you've several users then Select Case Application.Username will be

more
appropriate]


FileOpen MyPath & "\" & filename

HTH
Henry

"Tod" wrote in message
...
My former solution to this problem has to change.

The former scenario:
I had a workbook in a folder on a server. In that same
folder I had a database. In my ADO code I had my
connection to the path and database name. Problem is that
when users tried to run the code from the workbook, the
connection string failed because the path (for them)was
incorrect. The solution was to put the path as
ThisWorkbook.Path and then the database name.

New Scenario:
As the list of files on the server has grown, I've
organized everything into subfolders. Now the workook and
database are on the same server, but one is in a Reports
folder and the other is a Database folder. So
ThisWorkbook.Path will not longer work as a part of the
connection string.

So... if you are still reading.... here's what I need. I
want to be able to run the workbook and it's ADO code from
within the server. That's easy enough. I can hard code the
path to the database. BUT.. I also want select users (as a
back up in case I'm 'hit by the proverbial bus') to be
able run the workbook from a folder on their computer that
I've shared to a folder on the server. The hard-coded path
for the connection string will not work.

Does anybody understand what I'm talking about?

tod