Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Erasing Outlook Calendar from within Excel

Jun 22, 2005 1:40AM PDT

I have several schedules in different Excel files that I need to export. I need to run the exporter from each file everyday to keep my Calendar up to date. How can I have the macro in each Excel file erase all items from the Outlook Calendar with a given address before it exports my dates? In other words: I run the Macro; it scans the outlook calendar and erases all entries in my Outlook Calendar with an address of "123 Anywhere St"; then it scans my list of dates and copies them from Excel to my Outlook Calendar. I already have the part written that scans my list of dates and copies them to Excel, it's just the erasing part I need help with. Right now when I run my macro to scan and export the dates it simply adds to the Calendar. If I already ran it once then I run it again, I'll have duplicate entries in Outlook. Also, how would I have Excel erase all events in Tasks with a given property (for the same reasons as the Calendar)? Thank you for the help.

Discussion is locked

- Collapse -
A little bit of help.
Jun 22, 2005 4:34AM PDT

Outlook is programmable in VBA, like Excel. And I suppose it's an OLE-compatible program.

So all you've got to do is open the the Outlook object, and run the VBA-code to do what you want in it from Excel.

I must admit I've never done it, so for me it's pure theory. But I found two helpful links with google:
http://www.exceltip.com/st/Basic_information_ about_OLE_automation_using_VBA_in_Microsoft_Excel/462.html
and
http://www.exceltip.com/st/Control_Outlook_ from_Excel_using_VBA_in_Microsoft_Excel/464.html

This is where I should start. I might continue by asking a colleague of mine or buying a good book on the subject, depending on what google has more to offer.
Don't expect to find somebody here to provide you with any custom code you need.

Kees

- Collapse -
Thank you
Jun 22, 2005 5:10AM PDT

Thank you very much for the reply. I'll check out those 2 sites. I've figured out how to link Outlook and Excel, it's just I haven't been able to find the particular code to erase Outlook Calendar & Task entries from within Excel. So continues the search, but nonetheless I really appreciate your response.

- Collapse -
Re: VBA in Outlook
Jun 22, 2005 6:28AM PDT

I found the VBA help in Access and Excel very good. Never tried the Outlook version. But it could be a good start on the Outlook particulars (objects, methods, properties).

There are a lot of helpful VBA sites on the net also. Google does a great job to find the info you need once you know a few keywords to direct the search. Start with VBA Outlook and then for example calender item or calender erase.

You seem to be knowledgeable enough to get this up and running.

Kees