473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

How to create a Outlook calendar entry from a date in Excel using VBA...

Hello -

disclaimer - I'm a super-novice at VBA -

I have VBA code that I found on the internet to create a calendar appointment entry in Outlook. I'm trying to modify this code so that the date of the calendar entry is obtained from cell D3 in my Excel spreadsheet - instead of being hard coded into the VBA. Initiatlly cell D3 was formatted as a date, but since I couldn't get that to work, I converted it to text (#12/2/2012#)

Can anyone help me find a way to getthe date value for the calendar entry from Excel?

Here is my code:

Expand|Select|Wrap|Line Numbers
  1. Dim objOL 'As Outlook.Application
  2.         Dim objAppt 'As Outlook.AppointmentItem
  3.         Dim nDate As String
  4.         Const olAppointmentItem = 1
  5.         Const olMeeting = 1
  6.         Const olFree = 0
  7.                 Range("d3").Select
  8.                 nDate = ActiveCell
  9.         Set objOL = CreateObject("Outlook.Application")
  10.         Set objAppt = objOL.CreateItem(olAppointmentItem)
  11.         objAppt.Subject = "Holiday 1"
  12.         objAppt.Start = nDate
  13.         objAppt.AllDayEvent = True
  14.         objAppt.BusyStatus = 3
  15.         objAppt.Save
  16.         Set objAppt = Nothing
  17.         Set objOL = Nothing
Oct 23 '12 #1
3 3262
Rabbit
12,516 Expert Mod 8TB
Did you try using the CDate() function to convert the string to a date?
Oct 23 '12 #2
Hi there, I didn't know to try that, but I just did and it worked! Thanks so much!
Oct 23 '12 #3
Rabbit
12,516 Expert Mod 8TB
No problem, good luck with the rest of your project.
Oct 23 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Bijoy Naick | last post by:
Looking for some guidance on how to send outlook calendar entries from an asp .net application. I could send a .ics attachment in an email, but an wondering if its possible to actually generate...
0
by: davidman73 | last post by:
Hi, I built an asp.net application that displays a calendar with some events. However, I'd like to add some functionality to allow users to click on an event and create an outlook calendar...
0
by: Joseph Burton | last post by:
I'm trying to find the code to export calendar data to excel just like the wizard does in outlook. I have been searching the internet left and right and can't find anything. Can this be done...
2
by: irfankhan5 | last post by:
Hi, I have an email account on 2003 Exchange Server. Now, I have to make available the Calendar part of this account available on my ASP.NET web application. Is there a way to embed Outlook into...
2
by: dunk_king | last post by:
Hi Anybody, i´m trying to show a calendar (dayview) in my own vb.net programm. This calendar sheet should get all items (of this day) of my local outlook calendar (Outlook 2000). Is something...
4
by: terbolee | last post by:
I'm wondering if there's a way to use a date field in an Access table so that reminders could be generated in MS-Outlook Calendar. I'd appreciate any help you can throw my way. Thanks.
1
by: Dusty1368 | last post by:
Good evening, I have this idea........ I want (someone) to design a template in Access or Excel (I was told it was these 2) and from which ever program data like date, time, location, and subject...
2
by: Mr K New | last post by:
I am new to Access and want to transfer data to and from outlook calendar ( from access ) I need the date, location, and subject fields does any versions of outlook and access do this or do I need...
7
cori25
by: cori25 | last post by:
I have data that I want to import from access into excel, I need to be able to pull in the data so that it can be automated to appear in calendar format. The dates are in the db, so I want it to be...
2
BenRatcliffe
by: BenRatcliffe | last post by:
Hi there, Has anyone got any idea how i can use details in entered into a form (and stored in a tale) to create a meeting in the outlook calendar. I have tried linking the calendar to the database...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.