|
-
Feb 28th, 2005, 10:34 PM
#1
PAth/File Access Error
trying to run the following code on an EXE (Actually Excel)
and Im getting the following error
Error 75
Path/File Access Error??
if I take off the Access Read Write etc...it works...until it hits PUT
any clues?
[Highlight=VB]
Private Sub ReverseByteNumbers(ByVal FileName As String)
Dim K As Long, byteArr() As Byte, FL As Integer
FL = FreeFile
Open FileName For Binary Access Read Write Lock Read Write As FL
ReDim byteArr(LOF(FL) - 1)
Get FL, , byteArr
For K = 0 To UBound(byteArr)
byteArr(K) = Not byteArr(K)
Next K
Put FL, 1, byteArr
Close FL
End Sub
[vbcoce]
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Feb 28th, 2005, 10:43 PM
#2
Re: PAth/File Access Error
You are operating sequentially. If you want to write from the beginning just close it and open it again. If you want to use direct access, you need the word RANDOM, and you must write all records the same length, and specify the Len parameter when opening the file. The least amount of work required on your part woud be just to close the file momentarily.
-
Feb 28th, 2005, 11:36 PM
#3
Re: PAth/File Access Error
I just ran your code on several different files and it worked every time (including excel.exe). Are you trying to do this across a network?
I would say with 99% certainty that you don't have the appropriate file access permissions to do what you're trying to do. That is basically what the error message is trying to tell you.
Last edited by pnish; Feb 28th, 2005 at 11:40 PM.
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
-
Mar 1st, 2005, 09:15 AM
#4
Re: PAth/File Access Error
hmmm...
i have full permission... (Its XP home)
and its not over a network.....
I try again tonight....
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Mar 2nd, 2005, 02:27 AM
#5
Re: PAth/File Access Error
OK. Here's a simple test to establish whether it's a permissions thing. Try and delete excel.exe (make a copy first).
Pete
No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|