Path not found

J

Jay

file2 is recognized in versions eariler than 2007. In 2007 I get a run time
error path not found. But file2 is delclared correctly and path is correct.
Take same code and it works in 2003 MOffice sends outs the emails with
correct file attachements.

If I spell out the file name in the code instead of file2 I can get it to
attach correct file within 2007 emails to each clinic.
How do I make these VBA scripts run in 2007 Office by using file2

Sub Button1_Click()
Dim App As Object
Dim Itm As Object
Dim file2 As String



Set App = CreateObject("Outlook.Application")
Set Itm = App.CreateItem(0)
With Itm
..Subject = "Medipass Member Report " & repdate

a = 2
file2 = Cells(a, 3)
.To = Cells(a, 2)
.Body = "Your clinics"
.Attachments.Add (file2)
.Send
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top