Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tod Tod is offline
external usenet poster
 
Posts: 13
Default Which Path not found?

When I get an error 76, path not found, is there a way for
the code to return which path it is talking about?

tod
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Which Path not found?

Tod,

Under what circumstances are you getting the error? Unless your
code is specifying a path, Excel will be using CurDir path.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Tod" wrote in message
...
When I get an error 76, path not found, is there a way for
the code to return which path it is talking about?

tod



  #3   Report Post  
Posted to microsoft.public.excel.programming
Tod Tod is offline
external usenet poster
 
Posts: 13
Default Which Path not found?

I have something like this:

On Error Goto LogIt

Workbooks.Open "C:\Path\FileName.csv"
Set fso = CreateObject("Scripting.FileSystemObject")

f = "C:\BP View\Updates\DigDash CSVs\DDDesktop.csv"
df = "C:\InetPub\wwwroot\dash\sla\data.txt"

fso.CopyFile f, df

'more code

LogIt:
'Code to shut everything down.
txtStream.WriteLine (Now & ": Procedure ended early
with error " & Err.Number & " " & Err.Description)


If I get the path not found error, I don't know which path
it is talking about.

tod

-----Original Message-----
Tod,

Under what circumstances are you getting the error?

Unless your
code is specifying a path, Excel will be using CurDir

path.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Tod" wrote in message
...
When I get an error 76, path not found, is there a way

for
the code to return which path it is talking about?

tod



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Which Path not found?

I think I'd check each piece:

Option Explicit
Sub testme()

Dim F As String
Dim DF As String
Dim DFFolder As String
Dim okToContinue As Boolean

okToContinue = True

F = "C:\BP View\Updates\DigDash CSVs\DDDesktop.csv"
If Dir(F) = "" Then
okToContinue = False
MsgBox F & " Not found"
End If

DFFolder = "C:\InetPub\wwwroot\dash\sla\"
If Right(DFFolder, 1) < "\" Then
DFFolder = DFFolder & "\"
End If
DF = "data.txt"

If Dir(DFFolder & "nul") = "" Then
okToContinue = False
MsgBox DFFolder & " doesn't exist"
End If

If okToContinue Then
FileCopy F, DFFolder & DF
Else
MsgBox "not copied"
End If

End Sub


And I used VBA's FileCopy, too. As long as F and DF aren't open, it seems more
straightforward to me.



Tod wrote:

I have something like this:

On Error Goto LogIt

Workbooks.Open "C:\Path\FileName.csv"
Set fso = CreateObject("Scripting.FileSystemObject")

f = "C:\BP View\Updates\DigDash CSVs\DDDesktop.csv"
df = "C:\InetPub\wwwroot\dash\sla\data.txt"

fso.CopyFile f, df

'more code

LogIt:
'Code to shut everything down.
txtStream.WriteLine (Now & ": Procedure ended early
with error " & Err.Number & " " & Err.Description)

If I get the path not found error, I don't know which path
it is talking about.

tod

-----Original Message-----
Tod,

Under what circumstances are you getting the error?

Unless your
code is specifying a path, Excel will be using CurDir

path.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Tod" wrote in message
...
When I get an error 76, path not found, is there a way

for
the code to return which path it is talking about?

tod



.


--

Dave Peterson

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
File Path Too Long? Not Anymore! Check out Long Path Tool Max Loger Excel Discussion (Misc queries) 1 March 24th 17 07:59 AM
http://CannotDeleteFile.net - Cannot Delete File? Try Long Path ToolFilename is too long? Computer Complaining Your Filename Is Too Long? TheLong Path Tool Can Help While most people can go about their businessblissfully unaware of the Windo Max Loger Excel Discussion (Misc queries) 0 June 14th 11 04:30 PM
Formula too long - new file path is shorter than old file path - Excel 2003 Greg J Excel Worksheet Functions 1 November 22nd 06 05:16 PM
hyperlink navigation path path wrong in Excel 2003 CE Admin Excel Discussion (Misc queries) 5 January 7th 06 07:47 PM
how to change absolute path to relative path hwijgerse Excel Worksheet Functions 0 November 25th 05 07:18 AM


All times are GMT +1. The time now is 01:48 AM.

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"