Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem w/ email attachment (xls) it's not the updated file

Status
Not open for further replies.

MY3MCS

Technical User
Apr 17, 2003
49
0
0
GB
Dear Everyone:

Here's my situation:

I have a program that could copy my dbf file to an excel file and attached it (xls) to email and send it to different addressees. My problem is the file being attached is the old file and not the latest file. How did
it happen? Can anybody help me with this problem?

Thanks..
 
How are you doing this? Manually - Automation? Perhaps if you can share a little code, it will make it easier to 'see' the problem.

Rick
 
MY3MCS (TechnicalUser):
My problem is the file being attached is the old file and not the latest file.

Could you, please, elaborate on that? In particular: when the DBF is being updated and how.

Also: do you replace existing XLS with the new XLS when you copy DBF to Excel table file?



Regards,

Ilya
 
Thanks for your reply. Here's my command in my program

Copy fields field1,field2,field3 to "C:Filename.Xl5 type XLS"
Then I have a program to send an email thru outlook and attach the copied file to it. the command is:

OItem.Attachment.Add("C:Filename.XLS")

The email is sending including the attached file but the file is not the latest one. It;s still the old one which should be replaced by the new file.

Hey Ilya, no I did not replace THE XLS file. Can you tell me how to do it? Thanks agaun guys!!!
 
MY3MCS (TechnicalUser):
Hey Ilya, no I did not replace THE XLS file. Can you tell me how to do it?

Possible sarcasm aside, you might want to:

a) make sure the file you are copying records to is the same you are attaching to E-Mail, because
Code:
Copy fields field1,field2,field3 to "C:Filename.Xl5 type XLS"

and
Code:
OItem.Attachment.Add("C:Filename.XLS")

seems to be dealing with different files, IMHO (note the files' names' extensions);

b) check the attributes of your XL5 (or XLS) file: if it's WinNT5/2K OS - you might have no rights to write onto your C: drive unless you are logged in as Administrator.

HTH.


Regards,

Ilya
 
MY3MCS (TechnicalUser):
Hey Ilya, no I did not replace THE XLS file. Can you tell me how to do it?

Probable sarcasm of yours aside, here's what you might want to do:

a) Make sure you are dealing with the same file because file name's extension in
Code:
Copy fields field1,field2,field3 to "C:Filename.Xl5 type XLS"

does not match file's extension in
Code:
OItem.Attachment.Add("C:Filename.XLS")

b) If the above is not the case, you might want to check that XLS (or XL5) file's attributes: is it, perchance, Read-Only? Note also, that if your machine runs under WinNT5/2K OS you may have no rights to write even on your own C: drive (unless you are logged in as Administrator).

HTH.


Regards,

Ilya
 
MY3MCS

Not thast this will solve your problem, but I believe this line should read:

Copy fields field1,field2,field3 to C:\Filename.XlS type XL5


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hey Mike:

I Got it. Thanks for your help. You're right as always.


Hey Ilya:

Thanks for your time too and It also helped my a lot. I appreciated your time with me guys..

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top