Excel - Remove Formatting Error

B

brianbartell

I have a workbook created from a macro that recently started to post
the following message ONLY when first opened:

"Excel encountered an error and had to remove some formatting to avoid
corrupting the workbook. Please re-check your formatting carefully"

I've searched the groups and the 'net and unfortunately have not found
much helpful information. If I open the file, save it, then open it
again it won't return the above message again. I wrote code to open
the file and save it, in essence trying to by-pass the error message,
but it still appeared. Does anyone have any suggestions?!?!?

Thanks in advance!!!

Brian
 
D

Dave Peterson

It sounds to me that the workbook (or maybe a specific worksheet in that
workbook) is close to being corrupted.

Maybe rebuilding that worksheet (or the whole workbook) would be in order.

You may want to try OpenOffice. Open your workbook in that, save it (as an
excel file) and see if that help cleans up your problem in excel.

http://www.openoffice.org, a 60-104 meg download or a CD
 
B

brianbartell

Well, I was successfully able to remove the formatting error, however
still have no idea what was causing it. The macro I have combines data
from all workbooks in a specific folder and creates a new file with
todays date. I decided to remove each workbook, one by one, and run
the macro on the smaller set of workbooks so that I could isolate the
problematic workbook. I was then able to find the workbook that was
somehow causing my error, even pinpoint the problematic worksheet,
however I still could not tell what the formatting error was. I simply
remade the workbook and pasted in the data by cell contents ( I first
tried to copy and paste the range of data, however still received the
formatting error by this method ). This solved my problem, for the
formatting error is no longer popping up. I can assume the formatting
error was somewhere within this range of data, but does anyone have any
solutions for finding out where the error might be specifically??? I'd
like to know a better way to trouble-shoot this if this error ever
shows its ugly head again...
 
D

Dave Peterson

I don't have a better solution than process of elimination--like you suggested.
 
B

brianbartell

well, the error popped up again so i did this to "solve" the problem:

I wrote code at the end of the macro to close the file that was just
created, & open it again. then i added a message box to confirm the
success of the new file creation, adding a note to tell the user to
remember to click save. i tried adding the save part into the macro,
but the error kept popping up until you manually clicked save in the
file. only problem here is if the user doesn't click save, but i'm
willing to risk it (this is at least a work-around)...
 
D

Dave Peterson

I hope it continues to work.

well, the error popped up again so i did this to "solve" the problem:

I wrote code at the end of the macro to close the file that was just
created, & open it again. then i added a message box to confirm the
success of the new file creation, adding a note to tell the user to
remember to click save. i tried adding the save part into the macro,
but the error kept popping up until you manually clicked save in the
file. only problem here is if the user doesn't click save, but i'm
willing to risk it (this is at least a work-around)...
 

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