View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Help with Late Binding in Excel

See how you can use late in the Outlook object model examples here
http://www.rondebruin.nl/sendmail.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




wrote in message ...
I have a sheet that is currently being converted to a pdf and e-mailed
on a nightly basis. I have an e-mail sheet button that reaches out to
a .pdf, attaches it to a message, and sends the message. Everything
was written in Excel 2000 but when the sheet is opened in Excel 2003
and then re-opened in Excel 2000 the Outlook reference is still
looking for Outlook 11. I've read that I can alter the code to use
late binding to solve this problem however I have not been able to
implement this successfully with my code. Could someone take a look at
the code below and tell me how I can alter it to make it late binding?
Your help is appreciated. Thanks


'Email Sheet

Dim WhatFile As String
Dim distRecipients As String
Dim distcc As String

WhatFile = "C:\Documents and Settings\admin\My Documents
\Sheet.pdf"

distRecipients = "
'distcc ='

Dim olApp As New Outlook.Application
Dim Msg As Outlook.MailItem

Set Msg = olApp.CreateItem(olMailItem)
With Msg
.To = distRecipients
.CC = distcc
.Subject = "Gauge Sheet"
.Attachments.Add Source:=WhatFile
.Send
End With

Set Msg = Nothing
Set olApp = Nothing

End Sub