View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
blayne blayne is offline
external usenet poster
 
Posts: 14
Default Path/File access error (Error 75) using Name Statement

The file path reads something like this;
C:\Directory\SubDirectory\JOB Folder\JOb File
What I am trying to do is
Write code to:
Open the JOb File
Change some of the information in the JOb File
through VBA User forms
Close the JOb File
and Change the Name of the JOB Folder
after the JOb File is Closed

What happens when the code executes is:
The Code opens the file
the User form modifies the information
the Code closes the file
but when the code reaches the Name statement I get
Path/File access error (Error 75)
At this point I am unable to change the Folder Name

I have tried to Manualy change the JOb folder name through Windows and I get
an
error message

I cannot change the file name untill I close Excel completely
The name statement code will work when I reopen Excel
and I can manualy change the JOb folder name

I have tried several "work arounds"
I tried to copy the Job file to a temporary folder and rename the JOB Folder
before saving the modified file to the renamed file
this did not work

I tried to redirect the Pointer using a dummy variable

I have reordered my code
so far nothing has worked

It is as if Windows "Thinks" the file is still open
evan though the Close method has executed
I have to close the Excel appllication to change this

is this a hang up in the Windows / Excel registery/buffers or "Whatever"
this is getting into an area I do not know alot about.

I am looking for some code to change the method I am using or the change
what file Windows thinks Excel has open

Thank you for your insights and help

--
Fuzzy logix


"JNW" wrote:

This can occur if you are renaming the folder that contains the open
workbook. This error can also occur while attempting to save a file that
would replace an existing read-only file. Without knowing where things are
located it's hard to say.

Where does the code stop?

"blayne" wrote:

I wrote the following code to rename a folder based on information entered
into an excel file contained in the folder

' ROUTINE TO MODIFY EXISTING INFORMATION
If Workbooks("FILE MANAGEMENT
SYSTEM.xls").Sheets("ONE").Range("CHANGE_EXISTING" ).Value = "YES" Then
Set InformationRegister =
Application.Workbooks("INFORMATION.xls").Sheets("I nformation register")
Call WritetoInfoRegister
Application.Run ".xls'!TenderInfoReport"
Call OpenRegister ' open register file
Call RewriteToRegister ' write new information to file
Call CLOSERegister ' close register file
Application.Workbooks("INFORMATION.xls").Save
Reset

Call RenameFolder

End If
End If
End If

The RenameFolder reads

Sub RenameFolder()
Dim OldName As String
Dim NewName As String
Dim dummyvar

Call CalcPath
' define the folder names
OldName = path & " " & Workbooks("FILE MANAGEMENT
SYSTEM.xls").Sheets("START"). _
Range("ProjShortName") & " " & Workbooks("FILE MANAGEMENT
SYSTEM.xls").Sheets("START"). _
Range("status2")
NewName = path & " " & Workbooks("FILE MANAGEMENT
SYSTEM.xls").Sheets("START"). _
Range("ProjShortName") & " " & Workbooks("FILE MANAGEMENT
SYSTEM.xls").Sheets("START"). _
Range("bidstatus")
dummyvar = "C:\File Setup"
Name OldName As NewName
End Sub

This is a very small portion but is the revelant section of the the code
I have tried the workaround found for excel 2000 to reset the pointer
and it has not worked

is there anyone who may have any ideas

--

Fuzzy logix

--
Fuzzy logix