Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is wrong with my UDF | Excel Discussion (Misc queries) | |||
What am I doing wrong? | Charts and Charting in Excel | |||
Insert Calculated Field (wrong Qty*Price = wrong Amount) | Excel Discussion (Misc queries) | |||
Where am I going wrong? | Excel Discussion (Misc queries) | |||
Where am I going wrong with this? | Excel Programming |