Open Access 2003 or 2007 from Excel
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?
|