Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Outlook Will Not Load
Tyrone Creed 
    
3 years ago
Hi
I built a database for my company to do purchase orders, in it there are emails setup to go to managers/directors and users. But if i have access open and a user opens their outlook, it errors saying that the ost file is in use. But then sometimes when the user has outlook open and access is trying to send an email i get a error as its not able to open a new mail.

Thanks
Adam Schwanz  @Reply  
           
3 years ago
What is the code you are using? Did it ever work or is it a new error? Was anything changed?
Richard Rost  @Reply  
          
3 years ago
That's a weird one. For weird stuff I usually say to check the Troubleshooter.

Usually stuff like that involves uninstalling (completely) and reinstalling Office.
Tyrone Creed OP  @Reply  
    
3 years ago
@Adam i have a global variable - i will post below - that works fine on my PC, but fails on others. So all my testing i never came across this issue until we started small scale testing. This is getting pushed out to the whole company by the end of the month, so really need to get this sorted 😥. The MD is one of the PC's having issues.
Tyrone Creed OP  @Reply  
    
3 years ago
@Rich i really dont want to go down that route if i can help it!!
Tyrone Creed OP  @Reply  
    
3 years ago
Public Sub SendEmailTO(EmailTo As String, msg As String, Email As String, EmailCC As String, EmailSub As String, Q As String, PO As String)

    Dim objOutlook As New Outlook.Application
    Dim objEmail1 As Outlook.MailItem
    Dim Signature As String

    Set objEmail1 = objOutlook.CreateItem(0)           'olMailItem)  <--- I thought this was the issue, but removing it only helped some users not all

    With objEmail1
        .Display    
    End With

    Signature = objEmail1.HTMLBody

    On Error Resume Next
    With objEmail1
        .To = EmailTo
        .CC = EmailCC
        .subject = EmailSub
        .BodyFormat = olFormatHTML
        .HTMLBody = msg & _
            Signature
        .Attachments.Add PO
        .Attachments.Add Q
'        .Display
        .Send
    End With
    On Error GoTo 0
    
    Set objEmail1 = Nothing
    Set objOutlook = Nothing
End Sub
Richard Rost  @Reply  
          
3 years ago
I wouldn't do both a .display and a .send. Pick one or the other. Either show it to the user so they can make changes and hit send themselves OR send it immediately.
Tyrone Creed OP  @Reply  
    
3 years ago
the display is comment blocked. I use it for testing. So in the above code it is just sending.
Kevin Yip  @Reply  
     
3 years ago
Hi Tyrone, if you don't want to reinstall Office, you can try to repair it.  Click the Start button, go to System, Apps, choose Outlook (or Microsoft 365, Microsoft Office), choose to "Modify" it, and you will get the option to repair it.
Tyrone Creed OP  @Reply  
    
3 years ago
Hi

I thought i would update you with how i have managed to get it working... for now anyway.

I changed my code in the top so that it checks to see if outlook is open first, if it is open it opens a new email, if it is closed it opens an Outlook instance and then a new email. This seems to be working for now, but will update it i find anything else. See code change below.
Tyrone Creed OP  @Reply  
    
3 years ago
Dim objOutlook As Object
    Dim objEmail1 As Object
    Dim Signature As String
    
On Error Resume Next
    Set objOutlook = GetObject(, "Outlook.Application")
    If objOutlook Is Nothing Then
        Set objOutlook = Nothing
        Set objOutlook = New Outlook.Application
    End If
On Error GoTo 0
Richard Rost  @Reply  
          
3 years ago
Thanks for sharing

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 11:20:47 AM. PLT: 1s