Error in Loading DLL while using late binding (Outlook)

CBass78

New Member
Joined
Aug 17, 2019
Messages
2
tl;dr - Converted from early to late binding to email a report using Outlook, now getting "Error in Loading DLL"


Good morning! I developed a tool for our production operations that automatically generates an email when a report is run. It was working fine for me using early binding, but then I was asked to roll it out to multiple users so I converted to late binding. It still works fine for me, but the other users are getting "Error in Loading DLL" faults when running the report. I thought the entire point of late binding was avoiding compatability issues across different versions of Excel?
Anyway, here's my code:


Code:
' Save and capture some variables
    ThisWorkbook.Save
      Dim DateCode
        DateCode = Range("E4")
      Dim EmailDate
        EmailDate = Range("B4")
      Dim FileNaem
        FileNaem = Range("B3")
' Open Email to send results
Dim OutApp As Object, objOutlookMsg As Object, objOutlookRecip As Object, Recipients As Object
  Set OutApp = CreateObject("Outlook.Application")
  Set objOutlookMsg = OutApp.CreateItem(0)
  Set Recipients = objOutlookMsg.Recipients
  Set objOutlookRecip = Recipients.Add("[EMAIL="people@places.com"]people@places.com[/EMAIL]")
  objOutlookRecip.Type = 1

  objOutlookMsg.Subject = EmailDate & " " & FileNaem
  objOutlookMsg.Attachments.Add ActiveWorkbook.FullName  
  For Each objOutlookRecip In objOutlookMsg.Recipients
    objOutlookRecip.Resolve
  Next
  
    Application.ScreenUpdating = True
  
  objOutlookMsg.Display

  Set OutApp = Nothing


Anything obviously wrong?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top