View Single Post
  #20   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Popping up message box with "Make Sure the Specified folder Ex

Yes, but you need to check (or Debug.Print) each path/file name in your code
before you try to open, to determine why it is failing.
Maybe the path/filename you are using in .Open is not what you think,
contains Unicode/unexpected characters, permission denied,
invalid/corruption etc.

NickHK

"Rajesh T S" wrote in message
...
FYI, the folder structure is as follows

SOURCE
---- AXA -- 46 Files
-------- Unrealised -- 20 Files
---- DDI11 -- 1 File
---- Ireland -- 2 File
-------- Dist_carry -- 1 File
-------- IP9ANd10 -- 1 File
---- Luxembourg -- 266 Files
---- UK -- 1 File

Totally around 306 files, some times it stops after processing 150 file,
sometimes it is 250...


"NickHK" wrote:

From the code you have posted and errors you are getting, I'm not

convinced
it's a memory problem but rather something to do with the files/file

names
you are trying to open.
As I cannot see your folder listing, I can't say

NickHK

"Rajesh T S" wrote in message
...
The Message box will have the below message

" File could not be accessed
- Make sure the specified folder exists
- Make sure the folder that contains the file is no read-only
- Make sure the file name does not contain any of the following

characters
<
? [ ] : ""
- Make sure the file/path name does not contain more than 218

characters
"
with the OK button in it and hangs after that. even if we press the OK
button it won't get closed.

I tried debugging the same and found the error
" error -1004
Method 'Open' of object 'Workbooks' failed" while opening the new file

In My case I'm reading and writing the same into another file and

closing
it. This happens smoothly if the no. of files is less than 250, other

wise
it
is popping up the above message

As you have mentioned even i think it might be some thing related to

memory,
since if i try the same thing after some an hour or so... then it is

running
fine..

This is where i'm getting confused..


"NickHK" wrote:

What does the msgbox say ?
Something about memory ?

You can open and close WBs all day, but maybe your code is not

releasing
some references/WB/resources as you think.

Copying WSs in a loop will raise memory problems sfter a while.

Possibly
copying graphics and chrats also.

NickHK

"Rajesh T S" wrote in message
...
The problem related to the opening large no of excel files and in

between
it
pops up a message box which need to be avoided while running the

macros
even
after using Displayalerts = false. This pop up comes up only when

no
of
files
are more than 250.

"NickHK" wrote:

For the record, what was the cause of the error ?

NickHK

"Rajesh T S" wrote in

message
...
Thanks for information and all the support NICK and TOM .

Thanks for all the help

"NickHK" wrote:

Well, you only open then close the WB so that is not a

concern.
And VBA can handle more than a 300 strings in an array.

NickHK
---------------- CUT ----------------------