Contacts From Worksheet To Outlook

Jun 5, 2007

I have been trying to use VB to send contacts from contacts.xls to outlook. I have some code from MSDN that shows me how to put in ONE contact (which is already declared in the code). Well I was thinking of writing something to take a worksheet that has x number of contacts and automating x number of contacts. The problem is, I am familiar with using SQL to pull records, but I was thinking there was something easier like importing the excel namespace. So I decided to try it out this way and found this little tidbit of code which is:

Dim xlApp As New Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
xlApp = New Excel.Application
xlApp.Visible = False
xlBook = xlApp.Workbooks.Open("contacts.xls")
xlSheet = xlBook.Worksheets(1)

'READ FILE HERE
Dim pXLRange As Object

pXLRange = xlSheet.UsedRange

Dim i = 0
Dim j = 0
For i = 1 To UBound(pXLRange, 1)
For j = 1 To UBound(pXLRange, 2)
Debug.Print(pXLRange(i, j))
Next
Next

It gives me this error for the FOR i=1 to UBound line:

Unable to cast COM object of type 'System.__ComObject' to class type 'System. Array'. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.

here's the namespaces i have imported:

Imports Outlook = Microsoft.Office.Interop.Outlook
Imports System.Reflection
Imports System.Data.OleDb
Imports Excel = Microsoft.Office.Interop.Excel

View 5 Replies


ADVERTISEMENT

Any Way To Import Excel Contacts To Outlook?

May 17, 2013

Wanted to know can I transfer excel sheet to outlook pst?? If yes then how can I do so??? As I have lots of contacts list in Excel sheet but now I wanted to import those contacts to Outlook.

View 2 Replies View Related

Get Outlook Contacts For Organization Using Excel Macro Vba?

Mar 14, 2014

How to get the outlook contacts for the organization using excel macro vba.

View 14 Replies View Related

WorkSheet Pasted Into Outlook

Jul 31, 2009

I am having trouble figuring out how to paste an Excel Worksheet into Outlook. I am using '07 versions for both. I currently have code that when a button is selected, Outlook opens and has form text that I have entered. I just cant figure out how to get the worksheet pasted into the body of the email after this text. Here is what I have:

View 3 Replies View Related

Send A .PDF Of 1 Worksheet Via Outlook

Aug 14, 2009

Im searching for a way to send a .PDF of 1 worksheet via outlook. I have seached the forum, and have tried to follow Ron De Bruin's web page on how to do this but fall short. Im currently using his code to send the excel sheet.

View 3 Replies View Related

Pull Information From Worksheet To Outlook

Aug 12, 2009

I want to setup an excel spreadsheet that will list employees and when exams were completed on them. The exams need to be completed once a year. I want the excel spreadsheet to send out an email to their corresponding supervisors when is within one month or so of an exam needing to be completed so their exam can be scheduled accordingly.

I have searched this forum and read through some of the other posts regarding exporting data from excel to outlook. This seems like what I need to do but I wanted to see if anyone has an advice on what way is better than the other?

Also, if excel is setup to push the data to outlook, does the excel file need to be open? In other words if Jimmy comes within one month of his exam but no one opens the excel file will it send out the email to outlook?

Is it a better option/ or possibility to have Outlook pull/check to see if the condition exists where an employee is within a month of his exam and then let the supervisor know?

View 2 Replies View Related

How To Open New Outlook Email By Filling Some Range Of Worksheet Using VBA

Aug 14, 2014

I have the following:

[C1] My dynamic email subject
[C5:C10] My dynamic email body message
My recipient is always same "burak@burak.com"

Now, I need a VBA code, that will automatically open a blank new outlook email window fill the fixed recepient fill the dynamic subject and body of the message from a range in my workbook.

Then just stop there so that I can attach some different files each time and send myself.

View 5 Replies View Related

Excel Macro (VBA) Sending Active Worksheet In PDF By Outlook

Mar 17, 2014

I find out a code to create a PDF (with opening the Save As dialog box) from an active worksheet, but I can't find out how to send this PDF by e-mail (Outlook). The code is working till the words 'Set OutApp'.

Just what I want is to send the active worksheet as PDF (as attachment) by email (Outlook). Here the present code.

Code:
Sub SendPDF()
'
' SendPDF Macro
'
Dim OutApp As Object
Dim OutMail As Object
Dim v As Variant
v = Application.GetSaveAsFilename(Range("E2").Value, "PDF Files (*.pdf), *.pdf")

[code]....

View 9 Replies View Related

Imported Contacts To Appear In Autocomplete?

Jun 17, 2013

Imported contacts to appear in Autocomplete?

View 1 Replies View Related

How To Check Duplicate Contacts

Aug 29, 2013

I have a workbook with a list of new contacts in one sheet, and a list of old contacts on another sheet.

I want to run a duplicate check throughout the workbook to highlight and delete any contacts on my new list, that have already been contacted on my old list.

Also, I need the the duplicate checker to check for non specific names, regardless of punctuation, upper/lower case, etc.

I need to to highlight all of the following variations as possible duplicates which i can then review & delete manually;

Apple Corp,
Apple Ltd
APPLE LTD
Apple.com
etc...

What I can use to do this?

View 3 Replies View Related

Merging Two Sets Of Contacts?

Oct 17, 2013

I am trying to merge my boss's contacts. He has one enormous set of contacts in GMail (5000+) and one enormous set of contacts in Excel (5000+) I've exported both sets into excel but how to I merge them?

The headers for each set are in a slightly different order (Home Address, Office Address, Email ...vs.....Office Address, Home Address, Email) Do I need to make sure the order of the headers match in both the GMail Sheet and the Outlook Sheet and is there a faster way to do that than just rearranging them manually?

My second question is how do I merge them? There are a lot of over-laps of people but some info might be different in Outlook than in GMail. For example I might have John Smith as a contact in both Gmail and Outlook but two different email addresses for him under the header "Email 1" how do I make sure one email doesn't eliminate the other? I just want to merge both sets of contact info for each person into one super contact.

View 4 Replies View Related

Tranpose Mulltiple Contacts From One Row

Apr 21, 2009

I would like to ask about How to Tranpose mulltiple contacts from one row.

Example:
Company1Firstname Lastname1 Firstname Lastname2 Firstname Lastname3Title1 Title2 Title3Company2Firstname Lastname1 Firstname Lastname2 Firstname Lastname3Title1 Title2 Title3
result need to be.

Company1Firstname1Lastname1Title1Company1Firstname2Lastname2Title2Company1Firstname3Lastname3Title3Company2Firstname1Lastname1Title1Company2Firstname2Lastname2Title2Company2Firstname3Lastname3Title3

View 9 Replies View Related

Number Of Unique Contacts

Sep 23, 2009

Client Id Contact No. Unique Contacts 111123 12 3 111123 12 3 221123 2 2 111123 34 3 111123 5 3 221123 1 2 821123 4 1 221123 2 2

I am trying to calculate the number of unique contacts that each client has made. So in the example above Client No. 111123 has made 3 unique contacts - numbers 12,34 and 5.

However I'm not having any luck - as I suspect it will be a fiendish array formulae. Alternatively I'd settle for some VBA.

View 9 Replies View Related

Dropdown Menu To Get Contacts In Sheet

Dec 20, 2012

i have a excel sheet which i use to estimate of course i have many contractors i use

my question is, is it possible to create a drop down menu with the contractors name and autofill the cells below with the address

Cell_B5 Company (Dropdown)
Cell_B6 111 Street Rd
Cell_B7 TownCity State 11111

or is it without a dropdown possible by just typing the first few letters and then autofill and how to do this

View 3 Replies View Related

Importing Phone Numbers And Contacts

May 15, 2007

How do i go about importing contacts - names, numbers, addresses that are in excel into Microsoft Outlook?

View 2 Replies View Related

Email Sheets To Various Contacts In PDF And Also Excel (but Locked)

May 13, 2014

Work on a spreadsheet with multiple sheets , that will then be emailed once a month, with different sheets going to different contacts because of our timezone difference.

If a sheet could be used to maintain a list of contacts and which sheet to email out Also in which format PDF, Excel (locked down) or both would be useful.

A button maybe on the contact sheet to start the process / but also with an option to set-up to email on a certain day per month would be good.

the number of contacts at the moment varies between 1 and 4 for each sheet - perhaps , we could set-up to email up to 10 contacts per sheet

The email client is Outlook

Each contact should only receive their sheet and not see any of the other sheets , also the contacts should not be able to alter the spreadsheet at all. hence the possibility of using PDF , but most still would like to see the report in excel format.

there would be about 20 sheets , to go to between 1 and 10 contacts for each sheet

I have attached a dummy workbook , which has 4 example worksheets in

In the real workbook, the worksheet names , also will have spaces in them.

I could setup a Start Sheet and a finish sheet - so that the macro - can go through each worksheet in between , if that offers a solution also a maintenance sheet which has the sheet name , email contacts email address and PDF, Excel or both format.

I have outlook on my PC , so i can play - BUT its not connected via exchange server, if that makes any difference.

View 2 Replies View Related

Merging Workbooks: So All The Information I Have About These Contacts Is In The Same Book

Jul 15, 2007

I have 2 books right now. Each book has 2 colums of data (See attached jpg.):

Book 1 has a column for "phone number" and another for "street"
Book 2 has a column for "phone number" and another for "house number"

I would like to merge these books together so that all the information I have about these contacts is in the same book. Column A will be the phone numbers, column B will be the street name, and column C will be the house number. As you can see by looking at book 2, I only have house numbers for some of the phone numbers in book 1. My goal here is to have book 2 "look at" book 1, and add any information book 1 does not have (such as house number) to the relevant row (the row where the phone numbers match). This new book will by my book 3. I've attached a jpg. with how book 1 looks, book 2 looks, and how I want book 3 to look.

View 2 Replies View Related

Excel Macro To Import Contacts And Place Them On Particular Sheet?

May 2, 2014

I have come up the code below. It imports contact information from Outlook contacts in a contact folder called Private Contacts. The below code has been copied and modified from this forum.

As it stands the macro creates a new workbook and places the data on that. What I need it to do is create a new worksheet with the name of private compare on the active workbook and then place the data on that worksheet.

[Code] .....

View 6 Replies View Related

Outlook ... SMS

Sep 6, 2009

I was reading http://www.excelforum.com/excel-prog...-in-excel.html And would like to give this a shot. So if you can school me a bit more on it.

Ok my cell provider is Vodafone Australia. (I cant seam to find any info on if they provide this service in australia)

http://www.microsoft.com/downloads/d...displaylang=en From reading this it uses the phone that is concted to the computer(my case USB).

View 6 Replies View Related

Outlook Tasks

Oct 30, 2007

I have searched and think I have found what I need to create Outlook tasks from my Excel spreadsheet. I'm hoping that someone here can help me pull it together into something that will be usable in my project tracking spreadhsheet...

I try to keep track of milestones... these milestones are listed in column B of my spreadsheet and are in rows 10 through about 105

For each of my customers I then keep 4 columns D, E, F, G - H, I, J, K - L,M,N,O - etc. Each group of 4 is a different customer....

The customer's first column (D, H, L, etc.) is a Due date of the Milestone that is found in column B.
The second column is a check box that I use to indicate when the milestone is complete
The 3rd column is the completion date
The last colum is just a filler space that helps to separate each customer.

What I would like to do is insert a button at the bottom of EACH grouping of 4 that when pressed would look at the first column for the customer group and for ANY Milestone that has a DUE date process the stuff in the VB below to create an OUTLOOK task for each item that has a DUE date. (It would be conceivable that as it stepped through each row for a customer group of columns that I could have it create 90+ Tasks in Outlook.

A couple of additional things... in row 110 for the first column of the customer I have a DATE or a blank. So for example in D110 it might be blank or a date like 10/29/2007. If it is blank then when I press the button it would loop through ADD the tasks for each row with a due date. If row 110 has a DATE I would get a popup indicating that the tasks are already in OUTLOOK and that they were added on whatever the date is in row 110... This is kind of the safeguard that I don't get the same group of tasks multiple times by pressing the button by mistake.

View 11 Replies View Related

Run An Outlook Calendar

Nov 17, 2008

Is there a possibility to run an Outlook Calendar in Excel via code? and share it between users.?

View 2 Replies View Related

VBA To Refer To Outlook

Jun 18, 2009

In Excel, I want VBA to refer to the SENT ITEMS folder in Outlook. I want to loop over all sent items, and if the email address satisfies a condition, then record that fact in Excel. I am good at VBA in Excel, and I have a passing knowledge of VBA in Outlook, but I don't know how to refer to Outlook within my Excel VBA.

View 2 Replies View Related

Set Tasks In Outlook..

Jan 20, 2010

I want to use excel to update the tasks in outlook. All I have is a due date (from A2) and a task (from B2) Here is the code I have got so far

View 2 Replies View Related

Minimize Outlook

Feb 13, 2007

I have vba code that opens Outlook so I can run code to send emails...

Application.ActivateMicrosoftApp (xlMicrosoftMail)

But I don't want it to be visible, I want it to be minimized.
If I try:

Set olApp = CreateObject("Outlook.Application")
olApp.WindowState = xlMinimized

I get an error "Object doesn't support this property or method" referring to:

olApp.WindowState = xlMinimized

I've tried:

Set olApp = CreateObject("Outlook.Application")

followed later with code to send emails,

Set objol = New Outlook.Application
Set objmail = objol.createitem(olmailitem)
With objmail
.To = EMTo
.cc = EMCC
.Subject = EMSubject
.Body = EMBody
.NoAging = True
.Attachments.Add EMFile
.Send
End With

But I get an error "You don't have appropriate permission to perform this operation" referring to:

Set objmail = objol.createitem(olmailitem)

Because of the way our network is designed, the only code that works to send emails is:

Application.ActivateMicrosoftApp (xlMicrosoftMail)
Set objol = New Outlook.Application
Set objmail = objol.createitem(olmailitem)
With objmail
.To = EMTo
.cc = EMCC
.Subject = EMSubject
.Body = EMBody
.NoAging = True
.Attachments.Add EMFile
.Send
End With

but Outlook remains open the whole time the emails are being sent until it's closed by code later on.

Is there a way to minimize outlook AND use the code above?

View 9 Replies View Related

Excel Links To Outlook?

Jul 21, 2014

link a date within a Excel sheet to the Calander in Outlook so a reminder can be triggered on said date.

View 2 Replies View Related

How To Outlook Email In HTML

Jun 26, 2014

Below I have my code that works great. What I would like to do is make it pull the .HTMLBody from a cell value instead of inbeded in the code so users can change, just like to I have it below for who I am sending it to. The issue is if I do it the same way I loose my signature and the font, size and color I have below. How can I do this.

range("P16") would be the 1st line of the mesage
range("P17") would be the 2nd line of the mesage
range("P18") would be the 3rd line of the mesage

All the sendkeys below copy a range and paste it below my message as a picture currently. That is fine.

[Code] .....

View 1 Replies View Related

Integration Of Outlook With Excel VBA

Feb 2, 2014

I'm in search of a VBA macro which will send a mail through outlook automatically with the count of files(.pdf + .msg files) in any given folder.

I work for an organization, where we use Outlook for mailing purpose.

Everyday Inventory(.pdf files and .msg files) will be saved in a folder that is to be processed.

I want a macro which should automatically send the total inventory (.pdf files + .msg files) through my outlook mailbox(say: me@outlook.com) to a my superiors outlook mailbox(say: superior@outlook.com).

If the macro sends that email to my superior before me and my superior logon to computers at perticular time (say: 7:00AM daily), need to plan our day at work.

View 3 Replies View Related

Export To Outlook Calendar

Aug 11, 2009

i am using the attached sheet to export data from excel to outlook calendar from last 2-3 months. Now suddenly it stopped working for me (I didn't amend the code)

All the data i have filled in is in the correct format but the code doesn't export the data after ROW 72.

View 11 Replies View Related

Create Outlook Appointment From VBA

Sep 2, 2009

I am probably overengineering my macro, but I would like to setup an outlook appointment in two peoples calendars from my userform. The macro has access to the email addresses of the selected persons, I just want to send date/time and subject.

View 2 Replies View Related

Outlook Email Warning

Oct 12, 2009

I have some code to literally email a workbook to a specific user. But when the email is sending...i am getting the warning form Outlook whethere to send or not. If the user clicks No...then this opens up a can of worms when asking to debug. Is there a way i which i can amend the code to disable this warning and send regardless...without changing security settings in outlook???

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved