Hi All, Sorry I am very new to this stuff and normally just pinch all my Excel code from the net. I have a very basic script working to send an email and attach a file pasted in below. When I add the file path and name directly to the code (as per the line that is commented out) it works fine but if I add it as a reference to a cell name it will not work. I guess I am doing something basic wrong but I have no idea why. The objMailItem.Subject references a cell in the file and it works perfectly.
Sub SendEmail()
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
objMailItem.Display
strEmailAddr = "info@u2.com.au"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Subject = Range("Calcs!C16")
objMailItem.Body = "Hi"
'objMailItem.Attachments.Add "C:\Macro Test File.xlsx"
objMailItem.Attachments.Add = Range("Calcs!J7")
Set objMailItem = Nothing
Set objOutl = Nothing
Sub SendEmail()
Dim objOutl
Set objOutl = CreateObject("Outlook.Application")
Set objMailItem = objOutl.CreateItem(olMailItem)
objMailItem.Display
strEmailAddr = "info@u2.com.au"
objMailItem.Recipients.Add strEmailAddr
objMailItem.Subject = Range("Calcs!C16")
objMailItem.Body = "Hi"
'objMailItem.Attachments.Add "C:\Macro Test File.xlsx"
objMailItem.Attachments.Add = Range("Calcs!J7")
Set objMailItem = Nothing
Set objOutl = Nothing