ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   E-mail from VBA not working anymore (https://www.excelbanter.com/excel-programming/306730-e-mail-vba-not-working-anymore.html)

ForSale[_29_]

E-mail from VBA not working anymore
 
Now everytime i try to send an e-mail from Excel i get the followin
error message:
Compile Error:
user-defined type not defined

and then it highlights:
olApp As Outlook.Application

i have several other workbooks that this works on, any idea why i
wouldn't work today

--
Message posted from http://www.ExcelForum.com


Frank Kabel

E-mail from VBA not working anymore
 
Hi
have you set a reference to the Outlook ob ject library?

--
Regards
Frank Kabel
Frankfurt, Germany


Now everytime i try to send an e-mail from Excel i get the following
error message:
Compile Error:
user-defined type not defined

and then it highlights:
olApp As Outlook.Application

i have several other workbooks that this works on, any idea why it
wouldn't work today?


---
Message posted from http://www.ExcelForum.com/


Paul Robinson

E-mail from VBA not working anymore
 
Hi
Check that you have a reference to the OutLook Library. In the VB
Editor go to Tools, References and look for OutLook. If it is not
clicked, OutLook objects are not recognised, and assumed to then be a
user defined type.
regards
Paul
ForSale wrote in message ...
Now everytime i try to send an e-mail from Excel i get the following
error message:
Compile Error:
user-defined type not defined

and then it highlights:
olApp As Outlook.Application

i have several other workbooks that this works on, any idea why it
wouldn't work today?


---
Message posted from http://www.ExcelForum.com/


ForSale[_33_]

E-mail from VBA not working anymore
 
yes, i have the reference. here's what's throwing me for a loop.
i have a workbook with that code that works. i opened it, copied th
code word for word and put it in a new workbook. i ran the origina
and it works, but doesn't work on the second workbook. what the world

--
Message posted from http://www.ExcelForum.com


Dick Kusleika[_3_]

E-mail from VBA not working anymore
 
ForSale

The reference doesn't copy over just because you copy the code. The new
workbook doesn't have the reference set. If you would like to copy the code
to different workbooks, consider using late binding.

http://www.dicks-clicks.com/excel/olBinding.htm

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"ForSale " wrote in message
...
yes, i have the reference. here's what's throwing me for a loop.
i have a workbook with that code that works. i opened it, copied the
code word for word and put it in a new workbook. i ran the original
and it works, but doesn't work on the second workbook. what the world?


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com