help help help

itsglitzy

Registered User.
Local time
Today, 18:02
Joined
Nov 12, 2004
Messages
30
hi im using this


Private Sub Label9_Click()
Set oEmail = Nothing
Set oOutlook = Nothing
Dim olApp As Object, olMail As Object

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
olMail.To = "marc.seenan@bskyb.com"
olMail.Subject = "BP Schedule" & TabName
olMail.Body = vbCrLf & " Hi" & vbCrLf & vbCrLf & " Please find attached the " & ReportBP & " Report" & vbCrLf & vbCrLf & " Regards" & vbCrLf & vbCrLf & " " & UserNames & vbCrLf & vbCrLf
olMail.Attachments.Add ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
olMail.Display

hi all im using the above code and it works fine

I have run a macro and at the end but what i need is for the code to look at at file in a folder and attach the file specified so i used the code below it keeps debugging, and the var avc_pip_daily_filename is empty

what i put in nad doesnt work please help

olMail.Attachments.Add "G:\Shsreports\Reports\Sent Mail\Year 2004-2005\Wk " & WeekNumber & "\" & avc_pip_daily_filename
:confused:
 
Where do you set this value at ?

avc_pip_daily_filename
 
hi

the avc value is a variable
 
OK - same question still. A variable needs to get its value from somewhere. For instance....
Code:
Dim MyPath as String
Dim MyFileName as String
MyPath = "C:\Folder\"
MyFileName = "AFile.txt"

If the variable is showing up null or empty like you said its becuase the value isnt getting set correctly or in the right place....
 

Users who are viewing this thread

Back
Top Bottom