Outlook Error 80010105
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Windows 10 has caused VBA MailItem run-time error up vote 0 down vote favorite I have just updated to Windows 10 and now the following VBA code from an Excel sheet causes a run-time error: Dim aOutlook As Object .... Set aOutlook = CreateObject("Outlook.Application") Set aEmail = aOutlook.CreateItem(0) aEmail.To = "emailaddress" Run-time error '-2147417851 (80010105)': Method 'To' of object'_MailItem' failed It is the same for Excel 2003 and Excel 2013. Can anyone suggest what needs to be done to fix this? excel vba windows-10 share|improve this question edited Aug 10 '15 at 21:33 asked Aug 10 '15 at 21:14 RGriffiths 1,80392857 1 How is aOutlook declared? Have a look at this article. –Matteo NNZ Aug 10 '15 at 21:27 Dim aOutlook As Object - at the very beginning as a global –RGriffiths Aug 10 '15 at 21:32 2 It looks like the error above then. They're saying you should use early-binding (i.e. add the reference to Outlook object model in the project before and declare directly as the proper type, instead of assigning the type lately). –Matteo NNZ Aug 10 '15 at 21:34 1 Reading your code though, I think the early-binding should be rather done on "aEmail". –Matteo NNZ Aug 10 '15 at 21:35 Thanks - you seem to have spotted the problem (I got nothing when I searched for that error number!!) Now I need to figure out what early-binding is :) –RGriffiths Aug 10 '15 at 21:43 | show 5 more comments 1 Answer 1 active oldest votes up vote 0 down vote accepted I have found the reason for the error albeit a little unclear to me as to why it makes Excel behave like this: VBA - How to bind early Outlook application share|imp
Forums Excel Questions Run-time error '-2147417851 (80010105)': Method 'To' of object'_MailItem' failed Results 1 to 2 of 2 Run-time error '-2147417851 (80010105)': Method 'To' of object'_MailItem' failedThis is a discussion on Run-time error '-2147417851 (80010105)': Method 'To' of object'_MailItem' failed within the Excel Questions forums, part of the Question Forums category; This function has been working perfectly fine until now and nothing has changed. The OutMail.To function is failing and if ... LinkBack LinkBack URL About LinkBacks Bookmark & http://stackoverflow.com/questions/31929303/windows-10-has-caused-vba-mailitem-run-time-error Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Dec 12th, 2013,03:48 PM #1 USAMax Board Regular Join Date May 2006 Location West Chicago, Illinois Posts 695 Run-time error '-2147417851 (80010105)': Method 'To' of object'_MailItem' failed This function has been http://www.mrexcel.com/forum/excel-questions/744813-run-time-error-2147417851-80010105-method-object_mailitem-failed.html working perfectly fine until now and nothing has changed. The OutMail.To function is failing and if I replace the Named Range with the string value of cell B11 it works. This fails everywhere this command uses a Named Range. Code: Function Mail_workbook_Outlook(Recipient As String) 'Working in Excel 2000-2013 'Mail a copy of the ActiveWorkbook with another file name 'For Tips see: http://www.rondebruin.nl/win/winmail/Outlook/tips.htm Dim wb1 As Workbook Dim TempFilePath As String Dim TempFileName As String Dim FileExtStr As String Dim OutApp As Object Dim OutMail As Object With Application .ScreenUpdating = False .EnableEvents = False End With Set wb1 = ActiveWorkbook 'Make a copy of the file/Open it/Mail it/Delete it 'If you want to change the file name then change only TempFileName TempFilePath = Environ$("temp") & "\" TempFileName = "Johns New Item Form " & Format(Now, "mm-dd-yy") FileExtStr = "." & LCase(Right(wb1.Name, Len(wb1.Name) - InStrRev(wb1.Name, ".", , 1))) wb1.SaveCopyAs TempFilePath & TempFileName & FileExtStr Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) 'On Error Resume Next Select Case Recipient Case "Buyer" With OutMail
be down. Please try the request again. Your cache administrator is webmaster. Generated Sun, 23 Oct 2016 17:54:33 GMT by s_nt6 (squid/3.5.20)
Forum Visual Basic Programming Visual Basic 6.0 Programming HELP! Run-Time Error '2144717851(80010105)' If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 2 of 2 Thread: HELP! Run-Time Error '2144717851(80010105)' Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode June 25th, 2001,12:37 PM #1 Bonovox011 View Profile View Forum Posts Junior Member Join Date Jun 2001 Location London, Ontario, Canada Posts 20 HELP! Run-Time Error '2144717851(80010105)' My VB program is used to manage contacts in stored in a public folder. The error only occurs the first time the program is run after a login. It happens when trying to create a contact on the .move event of a ContactItem. Here is some code, hopefully you can help me out! thanks in advance, Bonovox011 Private Sub cmdCreate_Click() On Err GoTo errorHandler 'Create an instance of Outlook Set objApp = New Outlook.Application 'Create a namespace within Outlook so that I can access folders Set objNameSpace = objApp.GetNamespace("MAPI") 'Make objContact a Conact Item in this instance of Outlook Set objContact = _ objApp.CreateItem(olContactItem) 'set the folder to a public folder "VF Contacts" Set objFolder = objNameSpace.Folders("Public Folders").Folders("All Public Folders").Folders("TIAS Public Folders").Folders("North America").Folders("United States").Folders("STR - Strathroy").Folders("VF Administration").Folders("VF Contacts") 'Attribute all the fields of the form to a spot in the contact form With objContact .CompanyName = txtComName.Text .BusinessAddressStreet = txtBusStreet.Text .BusinessAddressCity = txtBusCity.Text .BusinessAddressState = txtBusState.Text .BusinessAddressCountry = txtBusCountry.Text .BusinessAddressPostalCode = txtBusPC.Text .BusinessTelephoneNumber = txtBusPhone.Text .OtherFaxNumber = txtBusFax.Text .FirstName = txtConFName.Text .LastName = txtConLName.Text .MobileTelephoneNumber = txtEmail.Text .Home2TelephoneNumber = txtWSIB.Text .HomeTelephoneNumber = txtInsurLiab.Text .TelexNumber = txtAttachS.Text .Department = txtAttachE.Text 'Save the changes made .Save 'Move them to the public folder .Move objFolder End With 'Reset the Instance of Outlook to nothing Set objContact = Nothing Set objApp = Nothing Set objNameSpace =