Error in code opening Outlook

  • Thread starter Thread starter muziq2
  • Start date Start date
M

muziq2

Hi,

I'm getting an error on another line that is supposed to open Outloo
and save add an appointment to the users calendar. The code is below.

The Private Sub cmdSave_Click() is highlighted as well as the Di
objApp as Outlook.Application.

Thanks in advance for your help.

Jeff

Private Sub cmdSave_Click()

Dim wb As Workbook

Dim objApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objAppointment As Outlook.AppointmentItem
Dim s As String, st As String, str As String, stri As String, strin A
String

On Error Resume Next
Set objApp = GetObject(, "Outlook.Application")
If Err.Number Then Set objApp = CreateObject("Outlook.Application")
On Error GoTo
 
Thanks. That is the error that I'm getting because the reference isn'
set in Excel '97. Excel 2000 users were not having the problem. I'l
try to change the code based on the link you provided.

Thanks again.

Jef
 
Back
Top