Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default unreadable content in file


Thank you patrick. I used your code and it shows the name of the file with
error and that is what I wanted.

Prema
"Patrick Molloy" wrote:

its difficult to tell .. but I'm guessing that you have an
ON ERROR RESUME NEXT
maybe?
I'd suggest that you use
DIM WB as Workbook
then use
SET WB = Nothing ' to ensure its null
SET WB = Workbooks.Open(sales_file_in & sName)
IF wb is nothing then
IF msgbox("Open manually",,"WORKBOOK NOT OPENED: " & sales_file_in &
sName)=vbYes Then
stop
end if


end if


using wb this way gives you greater control and to close
WB.Close False
closes it wiythout saving


"Prema" wrote:

I have code below to open and process all files in a particular directory. My
code runs in 2007. Files in directory are saved by different users with
various Excel versions.

Somtimes one of the files in the directory is not processed and when I open
the file manually pop up message displays "Excel found unreadable content in
... Do you wanr to recover the contents of this work book?" If I say yes then
workbook opens.I don't get this message even when I run with display alert
True.

If after manually opening the file and re-save I am able to run my code. Is
there any code I can include to automatically recover or at least display pop
up message as in manual open so that yes button can be used for thr file to
be processed
sales_file_in = "\\gbrcrotpc0ms015\1 To be processed\"
sName = Dir(sales_file_in & "*.*")

' Loop and process all file in sales_file_in directory
Do While sName < ""
Workbooks.Open Filename:= _
sales_file_in & sName

.
.
more statements
.
.

sName = Dir()
Loop


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
Unreadable Content Errors jday Excel Programming 1 October 31st 12 06:00 PM
UNREADABLE CONTENT Tree Excel Discussion (Misc queries) 0 March 30th 10 04:16 PM
excel found unreadable content in file..... do you want to recover madds Excel Discussion (Misc queries) 4 September 1st 09 07:21 PM
error - unreadable content in pivot table file - how do I find it BarbC Excel Worksheet Functions 1 March 30th 09 06:09 PM
unreadable content Miri Excel Discussion (Misc queries) 1 April 24th 08 08:09 AM


All times are GMT +1. The time now is 09:10 PM.

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

About Us

"It's about Microsoft Excel"