Excel Vba Runtime Error 287
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have run time error 287 excel Meta Discuss the workings and policies of this site About Us
Vba Send Email Error 287
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with excel vba runtime error 438 us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just excel vba runtime error 9 subscript out of range like you, helping each other. Join them; it only takes a minute: Sign up Using Excel VBA to create email in Outlook 2010 from template up vote 0 down vote favorite 1 I have code that worked well in Excel/Outlook 2003 on XP, I'm now running Windows 7 Excel/Outlook 2010 and receive an error: Run-time error '287':
Excel Vba Runtime Error 1004
Application-defined or object-defined error. My code is based on this answer in: Send an email from Excel 2007 VBA using an Outlook Template & Set Variables I'm creating my outlook object and mailitem like this: Dim MyOlApp Dim MyOlItem Set MyOlApp = CreateObject("Outlook.Application") Set MyOlItem = MyOlApp.CreateItemFromTemplate(Range("oftLocation").Value) 'user defined location The error appears after I reference MyOlItem, the code is replacing references in the .htmlBody Amending to .Body makes no difference, same error shows. My references in VBA are set to: VBA Microsoft Excel 14.0 Object Library OLE Automation Microsoft Office 14.0 Object Library Microsoft Forms 2.0 Object Library Microsoft Scripting Runtime vba templates excel-vba outlook oft share|improve this question edited Dec 3 '14 at 10:53 Jean-Francois Corbett 23.9k1678113 asked Nov 27 '14 at 10:21 Nik Burns 2,49421833 Have you tried defining the variables you are creating As Outlook.Application and As Outlook.MailItem? Also, have you tried defining the location reference for where the Range("oftLocation").Value is coming from? Trying to determine how the user is defini
generate the error 287 at the objMail.Send. I think the path is wrong, but I don't know why. If I use "On Error excel vba runtime error 91 Resume Next" above the Send, then there is no error popping up, excel vba runtime error 1004 application-defined or object-defined error but there is no email sent, either. Please show me how to fix it. Thank you. ------ strDocName =
Excel Vba Runtime Error 1004 Select Method Of Range Class Failed
"frmStud" DoCmd.openfORM strDocName, acPreview, , "studId='" & glbStudId & "'" FileName = strDocName & ".pdf" DoCmd.OutputTo acOutputForm, strDocName, acFormatPDF, "C:\Temp\StudentForms\" & FileName, False ‘========================================== 'Using Outlook programming codes .... '========================================== http://stackoverflow.com/questions/27168199/using-excel-vba-to-create-email-in-outlook-2010-from-template Dim objOutlook As Object Dim objMail As Outlook.MailItem Set objOutlook = CreateObject("Outlook.application") Set objMail = objOutlook.CreateItem(olMailItem) objMail.To = "" objMail.Subject = "test sending a form" objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName 'On Error Resume Next objMail.Send Set objOutlook = Nothing Tim, Apr 9, 2010 #1 Advertisements Daniel Pineault Guest Take a look at http://www.devhut.net/index.php?lang=en&pid=0000000013#OutlookAuto For a full Outlook automation function example which you http://www.pcreview.co.uk/threads/application-defined-or-object-defined-error-287.3994249/ can either simply use or use to fix your code with. -- Hope this helps, Daniel Pineault http://www.cardaconsultants.com/ For Access Tips and Examples: http://www.devhut.net Please rate this post using the vote buttons if it was helpful. "Tim" wrote: > My codes generate the error 287 at the objMail.Send. I think the path is > wrong, but I don't know why. If I use "On Error Resume Next" above the Send, > then there is no error popping up, but there is no email sent, either. Please > show me how to fix it. Thank you. > ------ > strDocName = "frmStud" > DoCmd.openfORM strDocName, acPreview, , "studId='" & glbStudId & "'" > FileName = strDocName & ".pdf" > DoCmd.OutputTo acOutputForm, strDocName, acFormatPDF, > "C:\Temp\StudentForms\" & FileName, False > ‘========================================== > 'Using Outlook programming codes .... > '========================================== > Dim objOutlook As Object > Dim objMail As Outlook.MailItem > > Set objOutlook = CreateObject("Outlook.application") > Set objMail = objOutlook.CreateItem(olMailItem) > > objMail.To = "" > objMail.Subject = "test sending a form" > > objMail.Attachments.Add "C:\Temp\StudentForms\" & FileName > > 'On Error Resume Ne
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time https://www.experts-exchange.com/questions/27485041/Send-Email-from-Excel-2007-causes-run-time-error-287.html Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers http://www.utteraccess.com/forum/runtime-error-287-t1949367.html Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Send Email from Excel 2007 causes run-time error 287 Want to Advertise Here? Solved Send Email time error from Excel 2007 causes run-time error 287 Posted on 2011-12-08 MS Excel Outlook Programming 1 Verified Solution 20 Comments 3,535 Views Last Modified: 2012-05-12 Hello Experts, I have a scheduled task on a Server 2008 R2 system that opens an Excel spreadsheet. VBA in the spreadsheet reads some sql data, creates some csv files, then emails a excel vba runtime summary. This was all working fine with our onsite Exchange Server 2003. We just updated to Office 365 so now our exchange is hosted by Microsoft. The original email code used the CDO method which did not require an interface to Outlook. Since that does not work with Exchange 2010, I changed the code to send the email through Outlook 2007. I configured the mail profile under the administrator account to connect to the proper account on Office 365. In Outlook \ Tools \ Trust Center \ Program Access it is set to "Never warn me about suspicious activity". So here's the problem. If I have Outlook open, the email is sent with no problem. If Outlook is not opened first, I get an error: Run-time error '287': Application-defined or object-defined error. Here is the send email code: Set oApp = CreateObject("Outlook.Application") Set oMail = oApp.CreateItem(0) With oMail .To = ThisWorkbook.Sheets("Setup").Cells(19, 2).Value .CC = ThisWorkbook.She
Custom Search UtterAccess Forums>Microsoft® Access>Access Automation Runtime Error 287 Forum HomeSearchHelpUA Messages|-- UtterAccess.com NewsAccess Knowledge Center|-- Access Code Archive|-- Access Knowledgebase / FAQ|-- Access TutorialsMicrosoft® Access|-- Local Access User Groups (AUGs)|-- Interface Design|-- Access Q and A|-- Access Tables + Relationships|-- Access Queries|-- Access Forms|-- Access Reports|-- Access Macros|-- Access Modules|-- Access Date + Time|-- Access Errors + Error Handling|-- Access Built-in Functions|-- Access Searching + Data Mining|-- Access Records|-- Access Security|-- Access Automation|-- Access Database Container|-- Tool bars, Menu bars + Ribbon|-- Access Services (Web Databases)|-- Access Data Access Pages (Deprecated)|-- Access Data Projects - ADP|-- Access Runtime, Packaging & DeploymentAnd More...|-- Microsoft SQL Server|-- SQL Server Reporting Services|-- Microsoft SharePoint|-- Microsoft Internet Explorer|-- Visual Basic 6 and Earlier|-- Visual Basic 2003 and Later|-- ASP and VBScript|-- Web Development|-- PHP, Perl, MySQL and Postgres|-- Other Database Engines|-- BI Tools and Applications|-- JAVA and C#|-- GraphicsMicrosoft® Office|-- Microsoft Excel|-- Microsoft Excel FAQs|-- Microsoft Word|-- Microsoft Outlook|-- Microsoft PowerPoint|-- Microsoft FrontPage/Exp. Web|-- Other Microsoft ProductsPC|-- Network Issues|-- Q & A - Hardware|-- Q & A - Software|-- Q & A - Other PC|-- Virus + Security DiscussionUtterAccess Odds and Ends|-- General Chat|-- Q & A - UtterAccess.com Forums|-- Q & A - Access Wiki Options psalmonView Member Profile Jul 26 2010, 04:26 PM Post#1Posts: 203Joined: 20-June 05From: Vancouver, B.C. CanadaI have a client running Office 2003. We have automated emails that run from Access and have for some time (years). He are using Express Click Yes 1.2 to bypass the Outlook messages, but are not even getting this far. There were some Microsoft updates done to the server over the weekend and now the jobs from Access are failing with Runtime error 287. The IT guys have backed out all of the updates that have a "removing" option and the jobs still fail. I am assigning various Outlook.Mailitems using the code below. When I set a breakpoint