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,
 

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