Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Outlook Email Reference

I am launching an inter-company spreadsheet that sends an email in a macro.
I am using Outlook version 11, but many others have outlook version 9.
Whenever a person using version 9 clicks the button that sends the email from
excel, it gives a reference error showing that reference library for Outlook
11 is missing. How can I include some code that will allow both Outlook v.9
and Outlook v.11 users to use the form without an error? Here is my current
code line for the outlook reference.

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strdate As String
Dim wb As Workbook
Dim ws As Worksheet
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")



Any Help is greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Outlook Email Reference

Hi sbruner

In every Outlook example on my site there is a example for Late Binding
http://www.rondebruin.nl/sendmail.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"sbruner" wrote in message ...
I am launching an inter-company spreadsheet that sends an email in a macro.
I am using Outlook version 11, but many others have outlook version 9.
Whenever a person using version 9 clicks the button that sends the email from
excel, it gives a reference error showing that reference library for Outlook
11 is missing. How can I include some code that will allow both Outlook v.9
and Outlook v.11 users to use the form without an error? Here is my current
code line for the outlook reference.

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strdate As String
Dim wb As Workbook
Dim ws As Worksheet
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")



Any Help is greatly appreciated.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Outlook Email Reference



note:
your code must compile without the outlook library:
Just using CreateObject does not constitute late binding..
(although you need it)

All variables must be defined as generic object variables.

Dim outApp as object 'generic vba object
Dim outApp as object

All constants which would be provided by the outlook library
must be defined inside your project or replaced with numeric value in
the code..

for code to work with ol9 and ol11 you must check
that you ONLY use methods/functions/procedures that exist
in both versions.

for normal development you'd need a machine with ol9.
Create the code WITH the library. Ensure it works in ol9.
Then edit code to latebound and remove the referenced library.
then test it can compile.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Ron de Bruin wrote :

Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Dim strdate As String
Dim wb As Workbook
Dim ws As Worksheet
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")

Reply
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
How do I set up Outlook email? new at outlook set up New Users to Excel 2 March 5th 09 08:31 AM
Outlook Email Jame-O New Users to Excel 1 November 7th 06 05:53 PM
Email & Outlook Chris Excel Discussion (Misc queries) 0 March 14th 06 12:04 PM
Late Binding to Outlook from Excel: Outlook modifies email body Lenny Wintfeld Excel Programming 0 December 12th 04 04:03 PM
Email from Excel WITHOUT Outlook Cindy Excel Programming 0 January 28th 04 04:30 PM


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"