Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default In VBA, check if file is corrupt or not Excel

I'm using Excel 2003.

Using VBA, I am looping through a number of excel files, extracting data
from each, and writing that data into another excel spreadsheet.

Occasionally, there is a Word document in the directory, and once there was
a corrupt Excel spreadsheet.

How do I check if the excel file that I'm trying to open is corrupt or not
in an Excel format?

Your help would be greatly appreciated!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default In VBA, check if file is corrupt or not Excel

Hi laavista

You can loop through only the excel files and if it can't open the file skip it

See
http://www.rondebruin.nl/copy3.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laavista" wrote in message ...
I'm using Excel 2003.

Using VBA, I am looping through a number of excel files, extracting data
from each, and writing that data into another excel spreadsheet.

Occasionally, there is a Word document in the directory, and once there was
a corrupt Excel spreadsheet.

How do I check if the excel file that I'm trying to open is corrupt or not
in an Excel format?

Your help would be greatly appreciated!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default In VBA, check if file is corrupt or not Excel

I've tried checking for an error code each time I open a file, but the user
gets an error message from Excel and it stops the program.

Any suggestions?



"Ron de Bruin" wrote:

Hi laavista

You can loop through only the excel files and if it can't open the file skip it

See
http://www.rondebruin.nl/copy3.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laavista" wrote in message ...
I'm using Excel 2003.

Using VBA, I am looping through a number of excel files, extracting data
from each, and writing that data into another excel spreadsheet.

Occasionally, there is a Word document in the directory, and once there was
a corrupt Excel spreadsheet.

How do I check if the excel file that I'm trying to open is corrupt or not
in an Excel format?

Your help would be greatly appreciated!

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default In VBA, check if file is corrupt or not Excel

More info please

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laavista" wrote in message ...
I've tried checking for an error code each time I open a file, but the user
gets an error message from Excel and it stops the program.

Any suggestions?



"Ron de Bruin" wrote:

Hi laavista

You can loop through only the excel files and if it can't open the file skip it

See
http://www.rondebruin.nl/copy3.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laavista" wrote in message ...
I'm using Excel 2003.

Using VBA, I am looping through a number of excel files, extracting data
from each, and writing that data into another excel spreadsheet.

Occasionally, there is a Word document in the directory, and once there was
a corrupt Excel spreadsheet.

How do I check if the excel file that I'm trying to open is corrupt or not
in an Excel format?

Your help would be greatly appreciated!

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default In VBA, check if file is corrupt or not Excel

Try clicking on Tools/Options... click the General tab on the dialog box
that appears and note which OptionButton is selected in the Error Trapping
panel... if it is "Break on All Errors", then that is your problem... change
the selection to one of the other two (my suggestion is "Break in Class
Module"... it does the same thing as "Break on Unhandled Errors" plus some
additional things).

--
Rick (MVP - Excel)


"laavista" wrote in message
...
I've tried checking for an error code each time I open a file, but the
user
gets an error message from Excel and it stops the program.

Any suggestions?



"Ron de Bruin" wrote:

Hi laavista

You can loop through only the excel files and if it can't open the file
skip it

See
http://www.rondebruin.nl/copy3.htm




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laavista" wrote in message
...
I'm using Excel 2003.

Using VBA, I am looping through a number of excel files, extracting
data
from each, and writing that data into another excel spreadsheet.

Occasionally, there is a Word document in the directory, and once there
was
a corrupt Excel spreadsheet.

How do I check if the excel file that I'm trying to open is corrupt or
not
in an Excel format?

Your help would be greatly appreciated!

.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default In VBA, check if file is corrupt or not Excel

On Dec 17, 3:12*pm, "Rick Rothstein"
wrote:
Try clicking on Tools/Options... click the General tab on the dialog box
that appears and note which OptionButton is selected in the Error Trapping
panel... if it is "Break on All Errors", then that is your problem... change
the selection to one of the other two (my suggestion is "Break in Class
Module"... it does the same thing as "Break on Unhandled Errors" plus some
additional things).

--
Rick (MVP - Excel)

"laavista" wrote in message

...



I've tried checking for an error code each time I open a file, but the
user
gets an error message from Excel and it stops the program.


Any suggestions?


"Ron de Bruin" wrote:


Hi laavista


You can loop through only the excel files and if it can't open the file
skip it


See
http://www.rondebruin.nl/copy3.htm


--


Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"laavista" wrote in message
...
I'm using Excel 2003.


Using VBA, I am looping through a number of excel files, extracting
data
from each, and writing that data into another excel spreadsheet.


Occasionally, there is a Word document in the directory, and once there
was
a corrupt Excel spreadsheet.


How do I check if the excel file that I'm trying to open is corrupt or
not
in an Excel format?


Your help would be greatly appreciated!
.- Hide quoted text -


- Show quoted text -


I will try this right away. Thanks!
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
Excel Corrupt File Znarf Excel Discussion (Misc queries) 3 July 7th 11 07:11 AM
How check if file to open is Excel or if Excel file is corrupt? laavista Excel Programming 4 November 19th 09 08:19 PM
Corrupt Excel File Hervinder Excel Discussion (Misc queries) 1 June 13th 06 01:09 PM
Corrupt Excel File Stephanie Colasurdo Excel Programming 1 January 6th 06 11:19 PM


All times are GMT +1. The time now is 06:52 PM.

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

About Us

"It's about Microsoft Excel"