Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Email Copy and File Not Found Message

We have an excel file that has a code that many of us use were the code
sets up an email and attaches a file to the email. The file has been
working fine for quite a while, but we now have two users were the file
gets the following message:

File not found: 'C:DOCUME~1\username.DSR\LOCALS~1\Temp\VB1C1.temp'

We also get a debug at the following code:

(Highlighted on this line) Sheets("Tasks").Copy
ActiveWorkbook.SaveAsFilename:="S:\Info\blanks\Tas kfiles.xls",
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False


On my system and many others, the file works fine, but on two users is
were the problem is. We tried using a system that the file works on
using the username of the person that the file doesn't and we have the
same problem. Any help would be greatly appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Email Copy and File Not Found Message

Is the S: drive is a network drive you may want to use it's name instead.
Oftentimes users don't map to the same drive letter. So instead of
S:\Info\blanks\Taskfiles.xls use \\network name\Info\blanks\Taskfiles.xls.

Try that. If it doesn't work try posting the code preceding the highlighted
line so we can get an idea as to what it's doing

"Lankchevy" wrote:

We have an excel file that has a code that many of us use were the code
sets up an email and attaches a file to the email. The file has been
working fine for quite a while, but we now have two users were the file
gets the following message:

File not found: 'C:DOCUME~1\username.DSR\LOCALS~1\Temp\VB1C1.temp'

We also get a debug at the following code:

(Highlighted on this line) Sheets("Tasks").Copy
ActiveWorkbook.SaveAsFilename:="S:\Info\blanks\Tas kfiles.xls",
FileFormat:=xlNormal, _
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False


On my system and many others, the file works fine, but on two users is
were the problem is. We tried using a system that the file works on
using the username of the person that the file doesn't and we have the
same problem. Any help would be greatly appreciated.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Email Copy and File Not Found Message

We updated the system that's not working to Excel 2003 and I replaced
the S:\ with the network name and it works fine on my system, but we
still get the same errors with the other system. Any other ideas?

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Email Copy and File Not Found Message

Can you post more of the code? I have a suspiscion that it's trying to email
the temp file instead of the one you have saved.

JNW

"Lankchevy" wrote:

We updated the system that's not working to Excel 2003 and I replaced
the S:\ with the network name and it works fine on my system, but we
still get the same errors with the other system. Any other ideas?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Email Copy and File Not Found Message

The following is one we have used for a while, but the names have been
changed to protect the innocent.

Darrell

Sub Send_Msg()
Dim objOL As New Outlook.Application
Dim objMail As MailItem
Set objOL = New Outlook.Application
Set objMail = objOL.CreateItem(olMailItem)

j = Range("From").Text


'save form as ffff.xls

Sheets("form").Copy
ActiveWorkbook.SaveAs FileName:="\\test-fs\File
Share\bids\ffff.xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False,
_
CreateBackup:=False
'convert to values
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues
'delete objects
ActiveSheet.DrawingObjects.Select
Selection.Delete
Application.DisplayAlerts = False
'delete range names
For Each r In Names
r.Delete
Next r
Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWorkbook.Close

msg = "Mary," & Chr(13) & Chr(13)
msg = msg & "The attached excel file shows a new job that needs to be
setup." & Chr(13)
msg = msg & "Please inform Fred of the Job number." & Chr(13) & Chr(13)
msg = msg & " Thanks," & Chr(11)
msg = msg & " " & j

addee = "
CC = "

With objMail
.To = addee
.CC = CC
.Subject = "New job"
.Attachments.Add "\\test-fs \File Share\bids\ffff.xls"
.Body = msg
.Display
'.Send

End With
Set objMail = Nothing
Set objOL = Nothing

Kill "\\test-fs \File Share\bids\ffff.xls"


'MsgBox "File has been e-mailed to " & addee (Removed because of
Security option in Outlook)

End Sub



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Email Copy and File Not Found Message

After further investigation, I have found that the problem exists when
we open the file using a shortcut, icon, or xla shortcut.
When I open the file by opening excel first and then open the file by
using the path file/open etc., the code works fine.
It seems for some reason that it can't figure out what the correct path
is without opening excel that way first.
The 2 guys with the problem can open the file that way, but I would
still like for them to use their shortcut or xla shortcut.
Any ideas?

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
macro to copy value from 2nd file, if a word found in a correspondingrow of both files [email protected] Excel Discussion (Misc queries) 5 September 2nd 08 10:51 PM
FOUND LOST FILE BUT COPY IS MISSING NITRAM RENRAS Excel Worksheet Functions 0 January 26th 06 08:03 PM
If not found get a message Fgomez Excel Programming 2 March 16th 05 10:28 PM
Copy and Paste from Excel into Outlook Email message TroyB[_2_] Excel Programming 0 November 10th 04 08:01 AM
"file not found" error message when launching source file Lisa[_9_] Excel Programming 4 April 6th 04 02:54 PM


All times are GMT +1. The time now is 02:12 PM.

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

About Us

"It's about Microsoft Excel"