Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-mail
Dear all,
I want to send e-mail via a list in a excel document so i try to write a macro. In my macro, for outlook i use the code; Dim OutApp As New Outlook.Application Dim OutMail As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) But i got an error " user-defined type not defined" I selected the Visual basic for applications Microsoft Excel 11.0 Object library OLE Automation Microsoft Office 11.0 Object Library Microsoft DAO 3.6 Object Library. So i wonder where the problem is and need your help in this situation... Kind regards, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-mail
Hi SupperDuck,
You need to add a reference to the Microsoft Outlook xxx Object Library. --- Regards, Norman "SupperDuck" wrote in message ... Dear all, I want to send e-mail via a list in a excel document so i try to write a macro. In my macro, for outlook i use the code; Dim OutApp As New Outlook.Application Dim OutMail As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) But i got an error " user-defined type not defined" I selected the Visual basic for applications Microsoft Excel 11.0 Object library OLE Automation Microsoft Office 11.0 Object Library Microsoft DAO 3.6 Object Library. So i wonder where the problem is and need your help in this situation... Kind regards, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Dear Norman,
Can you please how can i make this? I do not know to add a reference.. Thanks, "Norman Jones" wrote: Hi SupperDuck, You need to add a reference to the Microsoft Outlook xxx Object Library. --- Regards, Norman "SupperDuck" wrote in message ... Dear all, I want to send e-mail via a list in a excel document so i try to write a macro. In my macro, for outlook i use the code; Dim OutApp As New Outlook.Application Dim OutMail As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) But i got an error " user-defined type not defined" I selected the Visual basic for applications Microsoft Excel 11.0 Object library OLE Automation Microsoft Office 11.0 Object Library Microsoft DAO 3.6 Object Library. So i wonder where the problem is and need your help in this situation... Kind regards, |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Ah sorry, adding the same things.
In my first post i forgot to write that there was Microsoft Outlook 11.0 Object library . There is it but still have problem... "Norman Jones" wrote: Hi SupperDuck, You need to add a reference to the Microsoft Outlook xxx Object Library. --- Regards, Norman "SupperDuck" wrote in message ... Dear all, I want to send e-mail via a list in a excel document so i try to write a macro. In my macro, for outlook i use the code; Dim OutApp As New Outlook.Application Dim OutMail As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) But i got an error " user-defined type not defined" I selected the Visual basic for applications Microsoft Excel 11.0 Object library OLE Automation Microsoft Office 11.0 Object Library Microsoft DAO 3.6 Object Library. So i wonder where the problem is and need your help in this situation... Kind regards, |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Are you sure about that (ToolsReferences), as that is exactly the error
that you get if you don't set a reference to the Outlook type library. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "SupperDuck" wrote in message ... Ah sorry, adding the same things. In my first post i forgot to write that there was Microsoft Outlook 11.0 Object library . There is it but still have problem... "Norman Jones" wrote: Hi SupperDuck, You need to add a reference to the Microsoft Outlook xxx Object Library. --- Regards, Norman "SupperDuck" wrote in message ... Dear all, I want to send e-mail via a list in a excel document so i try to write a macro. In my macro, for outlook i use the code; Dim OutApp As New Outlook.Application Dim OutMail As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) But i got an error " user-defined type not defined" I selected the Visual basic for applications Microsoft Excel 11.0 Object library OLE Automation Microsoft Office 11.0 Object Library Microsoft DAO 3.6 Object Library. So i wonder where the problem is and need your help in this situation... Kind regards, |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Hi SupperDuck,
Providing I had set a reference to the Microsoft Outlook Object Library (In the VBE, Tools | References), I could not repoduce your error. Incidentally, but with no bearing on your problem, perhaps your code should read: Dim myOlApp As Outlook.Application Dim myItem As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) --- Regards, Norman "SupperDuck" wrote in message ... Ah sorry, adding the same things. In my first post i forgot to write that there was Microsoft Outlook 11.0 Object library . There is it but still have problem... |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Hello Norman,
Thank your for replies. The problem was, when two Excel files are opened and i select the Microsoft outlook object library, there is a probability of not been seen by one of the files. Is there a way for selecting these libraries, in all excel files including the new opened ones? Thanks... "Norman Jones" wrote: Hi SupperDuck, Providing I had set a reference to the Microsoft Outlook Object Library (In the VBE, Tools | References), I could not repoduce your error. Incidentally, but with no bearing on your problem, perhaps your code should read: Dim myOlApp As Outlook.Application Dim myItem As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) --- Regards, Norman "SupperDuck" wrote in message ... Ah sorry, adding the same things. In my first post i forgot to write that there was Microsoft Outlook 11.0 Object library . There is it but still have problem... |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Hi SupperDuck,
References are specific to a given workbook. If you wish to add a reference to all new workbooks, open the workbook template ( in my case, Book.xlt in my XLSTART folder), add the required reference(s), save and close the template. --- Regards, Norman "SupperDuck" wrote in message ... Hello Norman, Thank your for replies. The problem was, when two Excel files are opened and i select the Microsoft outlook object library, there is a probability of not been seen by one of the files. Is there a way for selecting these libraries, in all excel files including the new opened ones? Thanks... |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Why don't you use late binding then. See
http://xldynamic.com/source/xld.EarlyLate.html -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "SupperDuck" wrote in message ... Hello Norman, Thank your for replies. The problem was, when two Excel files are opened and i select the Microsoft outlook object library, there is a probability of not been seen by one of the files. Is there a way for selecting these libraries, in all excel files including the new opened ones? Thanks... "Norman Jones" wrote: Hi SupperDuck, Providing I had set a reference to the Microsoft Outlook Object Library (In the VBE, Tools | References), I could not repoduce your error. Incidentally, but with no bearing on your problem, perhaps your code should read: Dim myOlApp As Outlook.Application Dim myItem As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) --- Regards, Norman "SupperDuck" wrote in message ... Ah sorry, adding the same things. In my first post i forgot to write that there was Microsoft Outlook 11.0 Object library . There is it but still have problem... |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
"User-defined type not defined" error when trying to send e-ma
Bob,
Is it possible to check if Outlook is actually installed (via VBA) without running into the Reference error? -- Trefor "Bob Phillips" wrote: Why don't you use late binding then. See http://xldynamic.com/source/xld.EarlyLate.html -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "SupperDuck" wrote in message ... Hello Norman, Thank your for replies. The problem was, when two Excel files are opened and i select the Microsoft outlook object library, there is a probability of not been seen by one of the files. Is there a way for selecting these libraries, in all excel files including the new opened ones? Thanks... "Norman Jones" wrote: Hi SupperDuck, Providing I had set a reference to the Microsoft Outlook Object Library (In the VBE, Tools | References), I could not repoduce your error. Incidentally, but with no bearing on your problem, perhaps your code should read: Dim myOlApp As Outlook.Application Dim myItem As Outlook.MailItem Set myOlApp = New Outlook.Application Set myItem = myOlApp.CreateItem(olMailItem) --- Regards, Norman "SupperDuck" wrote in message ... Ah sorry, adding the same things. In my first post i forgot to write that there was Microsoft Outlook 11.0 Object library . There is it but still have problem... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Message "user defined type not defined" | Excel Discussion (Misc queries) | |||
User-defined data type; Error: Only User-defined types... | Excel Programming | |||
"User-defined type not defined" vb msg | Excel Programming | |||
"Application-defined or object-defined error" while printing excel report | Excel Programming | |||
Why "User-defined type not defined" | Excel Programming |