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: 213
Default Error on submitting an Excel Sheet using Outlook

I submitted the same tread a few weeks ago. As of today, I have not found a
solution for the problem. I hope one of you had the same experience in the
past and would like to share with me on the solution of the problem.

Basically, I use the code from Ron (see below) to email an Excel sheet using
Microsoft Outlook. Everyone in the company who uses this code has no problem
using it, except one person. Everytime, he uses it on his computer he
receives an automation error (Runtime error: 2147024770(8007007e)). When I
debugged it, it pointed me to the code "Set OutApp =
CreateObject("Outlook.Application")".

When I ask him to send me his file (so that I can try it on my computer) and
when I try it on my computer, I don't have any problem.

I checked "References" in VBA on his computer, and he has all the references
that I use. I also tried to submit the sheet when the Outlook is opened, and
I still had problem.

I know the problem is on his computer, not the code. I am trying to figure
out what he is missing on his computer to trigger that problem.

Any help is appreciated.

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim wb As Workbook
Dim strdate As String
strdate = Format(Now, "dd-mm-yy h-mm-ss")
Application.ScreenUpdating = False
ActiveSheet.Copy
Set wb = ActiveWorkbook
With wb
.SaveAs "Part of " & ThisWorkbook.Name _
& " " & strdate & ".xls"
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = "Hi there"
.Attachments.Add wb.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Send 'or use .Display
End With
.ChangeFileAccess xlReadOnly
Kill .FullName
.Close False
End With
Application.ScreenUpdating = True
Set OutMail = Nothing
Set OutApp = Nothing

 
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 and Outlook 2010 dll error DC Setting up and Configuration of Excel 0 May 19th 10 11:35 PM
importing contacts from excel to Outlook error geno Excel Discussion (Misc queries) 2 May 10th 10 10:34 PM
Submitting An Excel Template Daniel Bunt Excel Discussion (Misc queries) 0 May 12th 07 02:12 AM
Generating numbers & submitting details from one sheet to another Meenakshi Sood Excel Worksheet Functions 0 February 9th 06 06:57 PM
Outlook Automation Error Problem - Can't locate Outlook Module Allan P. London[_2_] Excel Programming 1 August 14th 05 10:52 PM


All times are GMT +1. The time now is 03:28 PM.

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"