PDA

View Full Version : Script to remove custom views



ukdane
05-12-2010, 12:34 AM
Hi,
Using Excel 2003
and shared files (I know, I know).
One of the problems of an ever increasing file size, is that Excel stores custom views for each user.
Does anyone know a way I can script so that when the Excel worksheet is closed down, it will remove the custom views that it has stored?

Thanks in advance.

Bob Phillips
05-12-2010, 01:09 AM
No idea if this works, I wouldn't touch shared files with a barge pole



Sub RemoveCustomViews()
Dim cv As CustomView

For Each cv In ActiveWorkbook.CustomViews

cv.Delete
Next cv
End Sub