Run-time error '1004': The file could notbe accessed.

S

siuping

Dear All,

Could you help me to solve the excel problem? The problem is:

I have a Excel 2000 file (includes some marco), there isn't any problem when
I run the marco in Windows 2000. but there is a error message when I run it
in Windows XP (Excel version is same).
There is prompted a box of Microsoft Visual Basic:

Run-time error '1004':
The file could not be accessed. Try on 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 folloing charaters: < >
? [ ] : | or *
.. Make sure the file/path name doesn't contain more than 218

The debug error coding on the following:

*****************
'Directory has to change
ActiveWorkbook.SaveAs Filename:= _
"\\Filesvr1\Base\public\LPD\Shipping Instruction\" & Customer & "\" &
Filename, FileFormat:=xlNormal _
, password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

'ActiveWorkbook.Close
******************

However, I can run it at Windows 2000, but cannot run it at Windows XP. Who
can help me to solve the problem.

Thank you very much and best regards,
 
N

Nick Hodge

Just a hunch, try taking any spaces out of the file name? Seems like a
registration issue. You might also check 'Ignore other applications' is
un-checked under Tools>Options...>General

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
web: www.nickhodge.co.uk
web: www.excelusergroup.org




siuping said:
Dear All,

Could you help me to solve the excel problem? The problem is:

I have a Excel 2000 file (includes some marco), there isn't any problem
when
I run the marco in Windows 2000. but there is a error message when I run
it
in Windows XP (Excel version is same).
There is prompted a box of Microsoft Visual Basic:

Run-time error '1004':
The file could not be accessed. Try on 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 folloing charaters: <? [ ] : | or *
Make sure the file/path name doesn't contain more than 218

The debug error coding on the following:

*****************
'Directory has to change
ActiveWorkbook.SaveAs Filename:= _
"\\Filesvr1\Base\public\LPD\Shipping Instruction\" & Customer & "\" &
Filename, FileFormat:=xlNormal _
, password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

'ActiveWorkbook.Close
******************

However, I can run it at Windows 2000, but cannot run it at Windows XP.
Who
can help me to solve the problem.

Thank you very much and best regards,
 
S

siuping via OfficeKB.com

Dear Nick,

Thank you for your reply. I have change the marco and setting following your
suggestion, but cannot work again. Actually it can run at Windows 2000
(Office 2000), but cannot run at Windows XP (Office 2000).
Anyway, thank you for your help.

Best Regards,
SiuPing

Nick said:
Just a hunch, try taking any spaces out of the file name? Seems like a
registration issue. You might also check 'Ignore other applications' is
un-checked under Tools>Options...>General
Dear All,
[quoted text clipped - 34 lines]
Thank you very much and best regards,
 
Joined
Jun 15, 2009
Messages
2
Reaction score
0
Visual Basic Run-Time error 1004

Run-TIme error '1004"
The file 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: <>?[]; shows file name or *
.Make sure the file/path name doesn't contain more than 281 characters

This can also happen when you just open Excel and no other file. If you just let it set there with the book1, that it opens at start up, it will do this run-time error with the same messages as listed above so it's message doesn't make any sense. When you have a file open and the message pops up it doesn't affect the saving of the file. When that message comes up I click end and then save the file. My message, however, has the Continue and Debug buttons grayed out.

Does not appear to be connected to auto-recovery as I've disable it and I've also changed the time set for doing auto recovery. I'm on a network so moved the path from the network to my C: drive and that didn't help either. Hope someone finds a solution soon it's annoying.

I've been working with this error for some time and think it started with an updated but can not determine when. I'm using Excel 2003 SP3 on WinXP sp3 system.
 
Joined
Jun 15, 2009
Messages
2
Reaction score
0
I've tried both of your suggestions and neither work.

If I just open the program Excel and let it set without opening any file, it gives that same error message. Just the blank worksheet that comes up when Excel opens.

And when I choose the 'ignore other applications' it wouldn't open up excel files at all by clicking on their names, I had to open excel and then do file open to get the file I wanted open so I took that option back to it's original state. I click on files a lot from Explore to open them so didn't like that feature being turned off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top