Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default VB Error in spreadsheet with no VBA code

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default VB Error in spreadsheet with no VBA code

Kathy,

What happens if they save the file first, then open it from Excel?

HTH,
Bernie
MS Excel MVP


"Kathy - Lovullo" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default VB Error in spreadsheet with no VBA code

They actually forwarded my e-mail back to me (with the attachment) and I
receive the same errors they see. When I originally create the e-mails and
open the attacmment I do not see the error. I also tried saving the file
attachment forwarded back to me to my desktop and I still receive the error.

When attempting to open the file, a Microsoft Visual Basic window opens
stating "File not found". If I click OK, it pops this exact same error a
second time (coincidentally, there are 2 worksheets in the file).

I then receive the following Microsoft Excel Error:
"Excel found unreadable countents in 'Affidavit.xls'. Do you want to
recover the contents of this workbook? If you trust the source of this
workbook, click Yes.

A "Repairs to "Affidavit.xls" window opens telling me "Lost Visual Basic
Project".

The "Repaired" spreadsheet opens up with the full functionality of my
spreadsheet.

I can save this as a new file and no longer see these error messages;
however I would not want to have trouble all the users at this client's
office with doing this.

Also, I opened the original attachment on the email (prior to sending) and
have verified once again that no VBA code exists.

Any ideas? I am baffled by the errors. We have sent this to 100 clients so
far and this is the only one with the problem.

"Bernie Deitrick" wrote:

Kathy,

What happens if they save the file first, then open it from Excel?

HTH,
Bernie
MS Excel MVP


"Kathy - Lovullo" wrote in message
...
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM
Error in Excel VBA Code (Error 91) dailem Excel Programming 1 August 25th 06 03:45 PM
How can I still go to the error-code after a On Error Goto? Michel[_3_] Excel Programming 2 May 4th 04 04:21 AM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM


All times are GMT +1. The time now is 11:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"