Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default what am i doing wrong


speaks for itsself really trying to send cell entries to outlook new
contacts on an event

Dim OutApp As Outlook.Application
Dim Newcon As Outlook.ContactItem
Set OutApp = CreateObject("Outlook.Application")
Set Newcon = OutApp.CreateItem(olContactItem)

If Target.Row = 14 And Target.Column = 1 Then
With Newcon
..FullName = Range("E1").Value
..MobileTelephoneNumber = Range("A11").Value
..Email1Address = Range("A12").Value
..HomeAddress = Range("A10").Value
End With
End If

no luck so far cant see where the code is wrong or am i being really
silly please help


--
short_n_curly
------------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
View this thread: http://www.excelforum.com/showthread...hreadid=385290

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default what am i doing wrong

Have you set a reference to the Outlook object library ?

From the VBE, select Tools - References, then select your version of Outlook
from the list.


Regards,
Vic Eldridge

"short_n_curly" wrote:


speaks for itsself really trying to send cell entries to outlook new
contacts on an event

Dim OutApp As Outlook.Application
Dim Newcon As Outlook.ContactItem
Set OutApp = CreateObject("Outlook.Application")
Set Newcon = OutApp.CreateItem(olContactItem)

If Target.Row = 14 And Target.Column = 1 Then
With Newcon
.FullName = Range("E1").Value
.MobileTelephoneNumber = Range("A11").Value
.Email1Address = Range("A12").Value
.HomeAddress = Range("A10").Value
End With
End If

no luck so far cant see where the code is wrong or am i being really
silly please help


--
short_n_curly
------------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
View this thread: http://www.excelforum.com/showthread...hreadid=385290


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default what am i doing wrong


yes i have selected this and still no joy is it the right code even i
beleive it should be but its not havining it


--
short_n_curly
------------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
View this thread: http://www.excelforum.com/showthread...hreadid=385290

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default what am i doing wrong


am i being totally stupid or do people simply not know the answer lol


--
short_n_curly
------------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
View this thread: http://www.excelforum.com/showthread...hreadid=385290

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default what am i doing wrong

Hi,

Surely your With code requires the . otherwise they will be treated a
variables. You might benefit from putting Option Explicit at the top of
your code module.

Dim OutApp As Outlook.Application
Dim Newcon As Outlook.ContactItem
Set OutApp = CreateObject("Outlook.Application")
Set Newcon = OutApp.CreateItem(olContactItem)

If Target.Row = 14 And Target.Column = 1 Then
With Newcon
.FullName = Range("E1").Value
.MobileTelephoneNumber = Range("A11").Value
.Email1Address = Range("A12").Value
.HomeAddress = Range("A10").Value
End With
End If

Cheers
Andy

short_n_curly wrote:
am i being totally stupid or do people simply not know the answer lol



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default what am i doing wrong


it has already the option explicit and worksheet change code at the top
of the page and with does have. befor the variables as the code shows
it also has end sub and no bugs identifed by debugging but still when
the event code is activated no joy cant understand why please help


--
short_n_curly
------------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...o&userid=21576
View this thread: http://www.excelforum.com/showthread...hreadid=385290

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default what am i doing wrong

I see the ng post is different from your forum post as in all the .'s
were removed.

You need to include a .Save command.

You might also want to move the createobject & CreateItem inside the
conditional test. No point in processing those line it the target area
is not correct.

Cheers
Andy

short_n_curly wrote:
it has already the option explicit and worksheet change code at the top
of the page and with does have. befor the variables as the code shows
it also has end sub and no bugs identifed by debugging but still when
the event code is activated no joy cant understand why please help



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
What is wrong with my UDF jlclyde Excel Discussion (Misc queries) 4 October 24th 08 03:06 PM
What am I doing wrong? tjbo Charts and Charting in Excel 3 October 10th 08 02:08 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
Where am I going wrong? Pank Excel Discussion (Misc queries) 2 July 13th 05 01:05 PM
Where am I going wrong with this? [email protected] Excel Programming 1 May 25th 04 05:04 PM


All times are GMT +1. The time now is 12:08 PM.

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

About Us

"It's about Microsoft Excel"