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

Hi

I have an excel spreadsheet which is used on different versions ie 97 & 2000.

I need to be able to email the spreadsheet using a macro however at the
moment I get a compile error.

We are unable to set the library reference on the 97 version because to save
the form we must run it through 2000 first.

Any idea's what I need to do to set the correct reference using code.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Reference Outlook in VBA

Take a look here http://www.xldynamic.com/source/xld.EarlyLate.html

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Noemi" wrote in message
...
Hi

I have an excel spreadsheet which is used on different versions ie 97 &
2000.

I need to be able to email the spreadsheet using a macro however at the
moment I get a compile error.

We are unable to set the library reference on the 97 version because to
save
the form we must run it through 2000 first.

Any idea's what I need to do to set the correct reference using code.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Reference Outlook in VBA

Hi Bob
I am trying to use the sample code however the following line stays red and
I dont know why

Set objRecipient.Add("John Wilson")

any idea's as I cannot test it until this is not red anymore.

thanks

"Bob Phillips" wrote:

Take a look here http://www.xldynamic.com/source/xld.EarlyLate.html

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Noemi" wrote in message
...
Hi

I have an excel spreadsheet which is used on different versions ie 97 &
2000.

I need to be able to email the spreadsheet using a macro however at the
moment I get a compile error.

We are unable to set the library reference on the 97 version because to
save
the form we must run it through 2000 first.

Any idea's what I need to do to set the correct reference using code.

Thanks




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Reference Outlook in VBA

Can we see the rest of the code?

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Noemi" wrote in message
...
Hi Bob
I am trying to use the sample code however the following line stays red
and
I dont know why

Set objRecipient.Add("John Wilson")

any idea's as I cannot test it until this is not red anymore.

thanks

"Bob Phillips" wrote:

Take a look here http://www.xldynamic.com/source/xld.EarlyLate.html

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Noemi" wrote in message
...
Hi

I have an excel spreadsheet which is used on different versions ie 97 &
2000.

I need to be able to email the spreadsheet using a macro however at the
moment I get a compile error.

We are unable to set the library reference on the 97 version because to
save
the form we must run it through 2000 first.

Any idea's what I need to do to set the correct reference using code.

Thanks






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Reference Outlook in VBA

Hi Bob

Below is the code I am using, I have marked the line which stays red and I
dont know why.

Dim objOutlook As Object
Dim objNameSpace As Object
Dim objMailItem As Object
Dim objRecipient As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")

Set objMailItem = objOutlook.CreateItem(0)

Set objRecipient.Add("John Wilson") **********Stays Red
objRecipient.Type = 1

objMailItem.Subject = "Testing Only"
objMailItem.Body = "Testing only"
objMailItem.Attachments.Add ActiveWorkbook.FullName

objNameSpace.Logon , , True
objMailItem.Send

Set objRecipient = Nothing
Set objMailItem = Nothing
Set objNameSpace = Nothing
Set objOutlook = Nothing

Thanks
Noemi

"Bob Phillips" wrote:

Can we see the rest of the code?

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Noemi" wrote in message
...
Hi Bob
I am trying to use the sample code however the following line stays red
and
I dont know why

Set objRecipient.Add("John Wilson")

any idea's as I cannot test it until this is not red anymore.

thanks

"Bob Phillips" wrote:

Take a look here http://www.xldynamic.com/source/xld.EarlyLate.html

--
---
HTH

Bob

__________________________________________
UK Cambridge XL Users Conference 29-30 Nov
http://www.exceluserconference.com/UKEUC.html

(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Noemi" wrote in message
...
Hi

I have an excel spreadsheet which is used on different versions ie 97 &
2000.

I need to be able to email the spreadsheet using a macro however at the
moment I get a compile error.

We are unable to set the library reference on the 97 version because to
save
the form we must run it through 2000 first.

Any idea's what I need to do to set the correct reference using code.

Thanks






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
Reference Outlook in Excel2003, but not working in Excel2000. jchen Excel Programming 0 August 22nd 06 02:09 AM
How can I reference an Outlook calendar holiday from Excel? Garhart Excel Discussion (Misc queries) 0 January 5th 06 08:38 PM
Outlook Email Reference sbruner Excel Programming 2 June 15th 05 09:59 PM
QUICK PLEASE Outlook object Reference name Ussiddiqui[_6_] Excel Programming 1 January 28th 04 09:45 AM
VBA reference to Outlook Torbjörn Steijer[_2_] Excel Programming 4 January 8th 04 12:45 AM


All times are GMT +1. The time now is 02:34 AM.

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"