Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
File Path Too Long? Not Anymore! Check out Long Path Tool | Excel Discussion (Misc queries) | |||
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 | Excel Discussion (Misc queries) | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
hyperlink navigation path path wrong in Excel 2003 | Excel Discussion (Misc queries) | |||
how to change absolute path to relative path | Excel Worksheet Functions |