?
Solved

VB.Environ Can't find project or library

Posted on 2011-03-17
6
Medium Priority
?
1,200 Views
Last Modified: 2012-06-21
Hi. I am getting the following error in the Access VBA code below
"Can't find project or library"

    MYDOC_DIR = VBA.Environ("userprofile") & "\my documents"
 
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 35155186
Try MYDOC_DIR = Environ("userprofile") & "\my documents"
0
 

Author Comment

by:Murray Brown
ID: 35155218
already tried that. Put the VBA on originally and the error went away
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 668 total points
ID: 35156396
FWIW remember that many users/network admins will change the name and/or location of the My Documents folder.

So you may not want to Hardcode this...
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 17

Assisted Solution

by:JezWalters
JezWalters earned 664 total points
ID: 35156397
It might be worth decompiling the database (taking a backup first) by running the following command:

    msaccess /decompile "<insert the full path to your database here>"

... and then recompiling the database again.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 668 total points
ID: 35159287
This is what I get on my system:

?VBA.Environ("userprofile")
C:\Documents and Settings\Administrator

mx
0
 

Author Closing Comment

by:Murray Brown
ID: 35166731
thanks for the help
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question