Open Access 2003 or 2007 from Excel
This is an Excel group.
But here is a suggestion
On Error Resum Next
Open from "C:\engel.mdb"
Open from "C:\" & Environ("UserName") & "\=Eng\engel.mdb"
On Error goto 0
change to the correc t opening code.
--
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Donna" wrote in message
...
There's 2 problems however; major one being I didn't write the code. I
know
a little about it & can get in there & change a few things, but as far as
knowing what you mean by "look at the value in Application.Operating
System",
I'm not sure how to do that.
The other problem is that that path on Vista will change as the user
changes
-- UserName portion of the path will be different depending on who is
using
the program at the time.
"barnabel" wrote:
Try looking at the value in Application.OperatingSystem We don't have
anything running Vista so I have no idea what it will say. XP returns
"Windows (32-bit) NT 5.01" Win 2K returns "Windows (32-bit) NT 5.00"
you can do something like:
if Application.OperatingSystem="Windows Vista" then
' open from c:\UserName\Engl\engl.mdb
else
' open from c:\engl.mdb
end if
"Donna" wrote:
I have an application created in Excel that at certain points opens a
database named "engl.mdb". All worked fine for years until some of us
got
new computers that now have VISTA as the OS. The database path is
c:\engl.mdb on the XP machines, but it can't be stored directly on the
root
of C in Vista because Vista has some sort of security thing going on
that
will only allow it to be opened in a READ-ONLY format. (I have
searched for
days on how to change this but get nowhere.) So now we need to store
the
database on the Vista machines in the following path --
c:\UserName\Engl\engl.mdb -- but on the XP machines the path is
c:\engl.mdb
Is there code that can be substitued in the current Excel VBA code that
can
call (Open) the database in either Vista or XP using the different path
names?
|