Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old November 5th 16, 01:35 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Nov 2016
Posts: 5
Default File cannot be accessed

Hi
I have a macro that sequentially opens data files (csv data in .rnd files), copies data to the main workbook, then closes the file. This normally works well but when the number of files reaches some arbitrary number, around 200, I get the message: Filename "cannot be accessed.The file may be corrupted, located on a server that is not working or read-only."
If I process in blocks of less than 150 the same file opens without problems. It would be good though to keep all 250 files together. Any ideas of how to avoid the issue?
Thanks,
Rod

  #2   Report Post  
Old November 6th 16, 03:31 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2003
Posts: 464
Default File cannot be accessed

"Rod" wrote:

I have a macro that sequentially opens data files (csv data in .rnd
files), copies data to the main workbook, then closes the file. This
normally works well but when the number of files reaches some arbitrary
number, around 200, I get the message: Filename "cannot be accessed.The
file may be corrupted, located on a server that is not working or
read-only."
If I process in blocks of less than 150 the same file opens without
problems. It would be good though to keep all 250 files together. Any
ideas of how to avoid the issue?


Post the code that's giving you trouble.

--
I'm not sure if you're serious, or trolling the troll.
  #3   Report Post  
Old November 7th 16, 04:08 AM
Junior Member
 
First recorded activity by ExcelBanter: Nov 2016
Posts: 3
Default

Quote:
Originally Posted by View Post
Hi I have a macro that sequentially opens data files (csv data in .rnd files), copies data to the main workbook, then closes the file. This normally works well but when the number of files reaches some arbitrary number, around 200, I get the message: Filename "cannot be accessed.The file may be corrupted, located on a server that is not working or read-only." If I process in blocks of less than 150 the same file opens without problems. It would be good though to keep all 250 files together. Any ideas of how to avoid the issue? Thanks, Rod
B*i đăng sao nhiều link thế. đừng spam nha bạn
  #5   Report Post  
Old November 8th 16, 03:53 PM
Junior Member
 
First recorded activity by ExcelBanter: Nov 2016
Posts: 10
Default

kêu Gấu Gam Mới chỗ phá vợ Nguyen đ*p về chị cả chồng đi Huyen Nguyen Tâm M*p Bùi nay đấy. gọi Đang Thu xong Jessica Gọi em Bui ăn gặp :v. trưa
Bảo Hiểm Daiichi life


  #6   Report Post  
Old November 8th 16, 04:38 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Nov 2016
Posts: 5
Default File cannot be accessed

Many thanks for this - I think you are right but cannot see a work around as I do shut the files as soon as I have copied the data I need.
I only ever have two files open at one time.
Regards,
Rod

  #7   Report Post  
Old November 8th 16, 04:41 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Nov 2016
Posts: 5
Default File cannot be accessed

On Sunday, November 6, 2016 at 3:32:00 PM UTC, Auric__ wrote:
"Rod" wrote:

I have a macro that sequentially opens data files (csv data in .rnd
files), copies data to the main workbook, then closes the file. This
normally works well but when the number of files reaches some arbitrary
number, around 200, I get the message: Filename "cannot be accessed.The
file may be corrupted, located on a server that is not working or
read-only."
If I process in blocks of less than 150 the same file opens without
problems. It would be good though to keep all 250 files together. Any
ideas of how to avoid the issue?


Post the code that's giving you trouble.

--
I'm not sure if you're serious, or trolling the troll.


Thanks for your reply. I am serious but I dont see the benefit of posting a large amount of code most of which is irrelevant. The bits that open and close the files are standard and work most of the time. However I suspect that a buffer is getting filled, or something. I just wondered if anyone had seen anything similar before.
  #8   Report Post  
Old November 8th 16, 05:58 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 735
Default File cannot be accessed

Many thanks for this - I think you are right but cannot see a work
around as I do shut the files as soon as I have copied the data I
need. I only ever have two files open at one time. Regards,
Rod


If you use ADODB to pull your data you won't have to open any files.
Here's where to start...

http://www.appspro.com/conference/Da...rogramming.zip

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #10   Report Post  
Old November 11th 16, 11:02 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 38
Default File cannot be accessed

Do you have proper error handling?
What could happen is that a file was opened but not closed as your code ended
prematurely due to an error.

RBS


On Tuesday, 8 November 2016 16:41:48 UTC, wrote:
On Sunday, November 6, 2016 at 3:32:00 PM UTC, Auric__ wrote:
"Rod" wrote:

I have a macro that sequentially opens data files (csv data in .rnd
files), copies data to the main workbook, then closes the file. This
normally works well but when the number of files reaches some arbitrary
number, around 200, I get the message: Filename "cannot be accessed.The
file may be corrupted, located on a server that is not working or
read-only."
If I process in blocks of less than 150 the same file opens without
problems. It would be good though to keep all 250 files together. Any
ideas of how to avoid the issue?


Post the code that's giving you trouble.

--
I'm not sure if you're serious, or trolling the troll.


Thanks for your reply. I am serious but I dont see the benefit of posting a large amount of code most of which is irrelevant. The bits that open and close the files are standard and work most of the time. However I suspect that a buffer is getting filled, or something. I just wondered if anyone had seen anything similar before.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
file could not be accessed - reference xlextras.xla Steve Excel Discussion (Misc queries) 2 November 3rd 08 04:17 PM
file.xls cannot be accessed...Read only... OA Excel Discussion (Misc queries) 7 February 26th 07 07:53 PM
File cannot be accessed KMc Excel Discussion (Misc queries) 2 July 20th 06 03:56 PM
file cannot be accessed, could be read only somnath shetty Excel Discussion (Misc queries) 2 April 10th 06 03:30 PM
"file" cannot be accessed FJB Excel Discussion (Misc queries) 4 May 18th 05 03:45 AM


All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017