Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - File could not be accessed error.

Status
Not open for further replies.

Edrondol

IS-IT--Management
Feb 20, 2003
63
US
I am running an Excel sheet with a macro attached to a command button. The first order of business in the macro creates a backup copy of the sheet. My PC does not like this, however.

The macro was created by another user in our shop, and I am the only one that is having this trouble.

The error reads:

The error could not be accessed. Try one of the following:

* Make sure the specified folder exists.
* Make sure the folder that contains the file is not read only.
* Make sure the file name does not contain any of the following characters: (it doesn't).
* Make sure the file/path name doesn't contain more than 218 characters.



Here's what I've tried:

* I've made sure that my Tools-->Macros-->Security is set at Medium.
* I've made sure that the file has met all of the parameters that should let it run.
* I've checked my level of security on all directories involved to ensure that I have full rights to them.

Any ideas what I can do besides uninstall/reinstall Office? Doing this would involve our comically slow support center and is low on my solutions list. I think that's about my only option left, but I'm being stubborn.

Thanks!

-Dave the Perpetually Confused
 
It sounds like the code is pointing to the incorrect location of your file. Are the files stored on a network drive for everyone, and if so, do you all use the exact same labeling of that network drive, or is it stored on your local pc? You may want to verify the file path for the actual document, and then verify the path being used by the VBA code to locate the document. That sounds like what it is to me, though I don't claim to always be correct! [wink]

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
The files are all located on a network and are accessed from the same area by all users. My PC just doesn't want to play well with the other kids' toys.




-Dave the Perpetually Confused
 
could you post the line of code that errors, along with a few lines before and after ?

Rgds, Geoff

"Three things are certain: Death, taxes and lost data. Guess which has occurred"

Please read FAQ222-2244 before you ask a question
 
On Error GoTo cmdReformat_Err

If Left(Range("B1").Value, 1) <> "L" Then
MsgBox "This sheet has been altered and can not be re-formatted. The reformatting will not be correct!"
End If

'-- save the backup copy of this file
ActiveWorkbook.SaveCopyAs cstrBackupPath & Month(DateTime.Date) & "-" & Day(DateTime.Date) & "-" & Year(DateTime.Date) & " " & Hour(DateTime.Time) & "-" & Right("0000" & Minute(DateTime.Time), 2) & "-" & Right("0000" & Second(DateTime.Time), 2) & " Distributed Accumulated Release Items Q0404.3 BACKUP.XLS"
'-- get the file name
strFileName = ActiveWorkbook.Name
'-- get the release ID from the file name
strReleaseID = Left(Right(strFileName, 11), 7)

'-- load the Columns Array with Column ID data
pLoadTheColumnsArray

'-- save a copy for an Executive Summary
'pSaveACopyForExecutiveSummary cstrWorkPath, cstrExecutiveSummaryFileName, strReleaseID

Windows(strFileName).Activate




-Dave the Perpetually Confused
 
I uninstalled and reinstalled and not it works fine. Thanks for all the help!




-Dave the Perpetually Confused
 
Okay. That sounded sarcastic. Seriously, thanks. I got some emails and tried a few things that didn't work. Reinstalling was the only thing that worked.

-Dave the Perpetually Confused
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top