Format mystery????

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Format mystery????

Post by Rudi »

Can anyone tell me what is happening to the formatting in this workbook?
It has a single sheet with data in cell A1 and A2
Change font colour, fill colour, font type...any formatting you want....
Save and close the file
Open the file

All the formatting is reset to Arial size 10 and black with not fill colours...???

There are no macros to reset the file...
Any ideas

TX

I did notice if I upgrade the format to *.xlsx the issue disappears. But I am still interested to know what is causing the initial "reformatting".
Another thing I just noticed...
The file is 1MB in size?????????? Yet there is nothing in the file. It's the darndest thing!!
(Don't worry...there is no virus in it!)
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Format mystery????

Post by HansV »

I don't really have an idea, but the workbook must be corrupt.
If I insert a new sheet into the workbook, it behaves the same way: all formatting is removed when you save, close and reopen the workbook.
If I copy the Summary sheet to a new workbook, it doesn't behave that way, but if I try to save the workbook as an Excel 97-2003 workbook, Excel warns that the workbook contains external links, yet File > Info doesn't show any links, and ActiveWorkbook.LinkSources is empty.
I'd copy the data that you need, and throw the workbook away.
Best wishes,
Hans

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Format mystery????

Post by Rudi »

TX for the confirmation. I thought I was going :bonkers: :nuts:

I have successfully transferred the data to a blank new (xlsx) format file.
Cheers
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
rory
5StarLounger
Posts: 817
Joined: 24 Jan 2010, 15:56

Re: Format mystery????

Post by rory »

Too many styles I think. Running this seems to fix it for me:

Code: Select all

Sub cleanStyles()
    Dim oStyle As Style
    For Each oStyle In ActiveWorkbook.Styles
        If Not oStyle.BuiltIn Then oStyle.Delete
    Next oStyle
End Sub
Regards,
Rory

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: Format mystery????

Post by Rudi »

Woah.....

Good find Rory...
I concur.
1.jpg
You do not have the required permissions to view the files attached to this post.
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.

User avatar
Leif
Administrator
Posts: 7209
Joined: 15 Jan 2010, 22:52
Location: Middle of England

Re: Format mystery????

Post by Leif »

I would never have put Rory down as a Style guru...
Leif

User avatar
rory
5StarLounger
Posts: 817
Joined: 24 Jan 2010, 15:56

Re: Format mystery????

Post by rory »

My wife always says I have a style, just not Style.
Regards,
Rory