K
Kathy - Lovullo
I am looking for some help with a Microsoft Visual Basic Error - "File not
found".
I have one spreadsheet with VB code in it which I am using to populate
another sheet in the workbook. The VBA code then saves 2 of the sheets as
new spreadsheet (without any VBA code) and then opens a prefilled Outlook
email to send with this new spreadsheet as an attachment. The main part of
the code for this is below.
The spreadsheet being sent to our clients has worked succesfully with all of
our clients but one. When they try to open the file attachment, they receive
the error File not Found error. The title bar of the error window shows
Microsoft Visual Basic, which is confusing me more as there is no VBA code on
this attachment. My spreadsheet was created in Excel 2003, this particular
client uses Excel 2000.
Any ideas?
'Save the new workbook/Mail it/Delete it
TempFilePath = Environ$("temp") & "\"
TempFileName = "Test File"
FileExtStr = ".xls": FileFormatNum = -4143
FileFormatNum = -4143
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail
.Subject = "Test Subject"
.Body = strbody
.Attachments.Add Destwb.FullName
.Display
End With
found".
I have one spreadsheet with VB code in it which I am using to populate
another sheet in the workbook. The VBA code then saves 2 of the sheets as
new spreadsheet (without any VBA code) and then opens a prefilled Outlook
email to send with this new spreadsheet as an attachment. The main part of
the code for this is below.
The spreadsheet being sent to our clients has worked succesfully with all of
our clients but one. When they try to open the file attachment, they receive
the error File not Found error. The title bar of the error window shows
Microsoft Visual Basic, which is confusing me more as there is no VBA code on
this attachment. My spreadsheet was created in Excel 2003, this particular
client uses Excel 2000.
Any ideas?
'Save the new workbook/Mail it/Delete it
TempFilePath = Environ$("temp") & "\"
TempFileName = "Test File"
FileExtStr = ".xls": FileFormatNum = -4143
FileFormatNum = -4143
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With OutMail
.Subject = "Test Subject"
.Body = strbody
.Attachments.Add Destwb.FullName
.Display
End With