#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 71
Default filecopy

This fails with a path or access 75

FileCopy "c:\crisnet\export\active.dbf",
"c:\crisnet\export\CMA_Toolkit_Data\CMA_ACT.db f"

The CMA_Toolkit_Data folder exists and this statement works on another
machine. I have been able to save to c:\crisnet\export only so I know that
the source part is working.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default filecopy

You don't mention whether you write to the destination folder though.

Try copying the below code into a module. Run the Sub Test and paste
back the debug results.

Sub Test()

fncFileAccessTest "c:\temp\crap.txt"
fcnFileAccessTest "c:\crisnet\export\CMA_ACT.dbf"
fcnFileAccessTest "c:\crisnet\export\CMA_Toolkit_Data\CMA_ACT.db f"

End Sub
Function fcnFileAccessTest(myPath As String)

Dim myFolder As String
Dim myFile As String
Dim F As Integer

myFolder = Left$(myPath, InStrRev(myPath, "\") - 1)
myFile = Mid$(myPath, InStrRev(myPath, "\") + 1)

Debug.Print "Testing for " & myPath
Debug.Print " Folder " & IIf(Dir(myFolder, vbDirectory) _
= "", "does not exist", "exists")
Debug.Print " File " & IIf(Dir(myFolder & "\" _
& myFile) = "", "does not exist", "exists")
F = FreeFile
Err.Clear
On Error Resume Next
Open myFolder & "\temp.tmp" For Output As #F
Debug.Print " You do " & IIf(Err.Number = 0, "", "NOT ") _
& "have write rights to this folder"
Kill (myFolder & "\temp.tmp")
Close #F

On Error GoTo 0

End Function


Marvin wrote:
This fails with a path or access 75

FileCopy "c:\crisnet\export\active.dbf",
"c:\crisnet\export\CMA_Toolkit_Data\CMA_ACT.db f"

The CMA_Toolkit_Data folder exists and this statement works on another
machine. I have been able to save to c:\crisnet\export only so I know that
the source part is working.

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
filecopy Question rjvega Excel Discussion (Misc queries) 2 July 8th 08 09:12 PM
FileCopy Andibevan[_2_] Excel Programming 2 May 18th 05 02:58 PM
FileCopy Andibevan[_2_] Excel Programming 6 May 12th 05 10:13 AM
FileCopy Dana DeLouis[_5_] Excel Programming 0 August 11th 03 12:57 PM
FileCopy John Green[_2_] Excel Programming 1 August 5th 03 08:55 AM


All times are GMT +1. The time now is 10: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"