Just got Excel 2010 and Macro Not Working Anymore

jtwusmc

New Member
Joined
Jan 8, 2011
Messages
33
I upgraded to Excel 2010 last week and when I went to use this Macro, it no longer worked. I just used in in 2007 and nothing has changed at all besides the upgrade. The line with the error is red below. Help!

Sub EmailNotes()
Dim objNotesSession As Object
Dim objNotesDb As Object
Dim objNotesDoc As Object
Dim vaRecipients As String
Dim r As Long
Dim Msg As String
On Error GoTo Error_Handling

Application.ScreenUpdating = False

Set session = CreateObject("Notes.NotesSession")
strServer = session.GetEnvironmentString("MailServer", True)
strMailfile = session.GetEnvironmentString("MailFile", True)

Set db = session.GETDATABASE(strServer, strMailfile)
' Set uiws = CreateObject("Notes.NotesUIWorkspace")
'
' If db.IsOpen = True Then
' 'Already open for mail
' Else
' db.OpenMail
' End If

For r = 9 To Range("BA65536").End(xlUp).Row
'Create the e-mail and add the attachment.
' Set objNotesDoc = objNotesDb.CREATEDOCUMENT

Msg = ""
Msg = Msg & Range("BF" & r) & "," & vbCrLf & vbCrLf
Msg = Msg & Range("BD" & r) & "." & vbCrLf & vbCrLf
Msg = Msg & "Thank you," & vbCrLf
Msg = Msg & "John Doe"

vaRecipients = Range("BA" & r)

CreateAndDisplayNotesEmail vaRecipients, Range("BE" & r) & " Timecard ", Msg, ""

'increment for the next person
r = r + 23
Next

MsgBox ("The e-mails have successfully been distributed."), vbInformation
ExitSub:
'Release objects from memory.
Set db = Nothing
Set session = Nothing
Set uiws = Nothing
Exit Sub
Error_Handling:
MsgBox "Error number: " & Err.Number & vbNewLine & _
"Description: " & Err.Description, vbOKOnly
Resume ExitSub
End Sub
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top