LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Outlook VB not working

Our PC at work when bad and was replaced witn a new one that is supposed be
exactly the same, but now I am getting a runtime error 429. when I debug it
highlights this line

Set OutApp = CreateObject("Outlook.Application")

do you have any idea of what is wrong. It worked great until they replace
our PC.
I have included the code below. We are using 2003


Option Explicit

Sub Mail_Sheet_Outlook_Body()
' Don't forget to copy the function RangetoHTML in the module.
' Working in Office 2000-2007
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With

Set rng = Nothing
Set rng = ActiveSheet.UsedRange


Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = Range("B14")
.HTMLBody = RangetoHTML(rng)
.Send
End With
On Error GoTo 0

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel working in with Outlook Diamontina Cocktail New Users to Excel 4 June 26th 07 09:54 PM
Reference Outlook in Excel2003, but not working in Excel2000. jchen Excel Programming 0 August 22nd 06 02:09 AM
Working with Outlook and Excel from Access ADG Excel Programming 1 June 6th 06 08:37 AM
email from cells to outlook - code not working periro16[_3_] Excel Programming 2 August 17th 05 04:24 PM
Excel Macro working with Outlook David Excel Programming 1 September 4th 03 05:44 PM


All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"