I have a file with many charts that are all the same format but pulling different information. I have organized so that 6 charts print on one page. My problem is that whenever I reopen the file, the charts tend to lose their formatting that existed when I previously saved and exited. For example, I added a text box to each one to act like a legend. In most charts, this tex box disappears. Also, the plot areas all get "scrunted" because the X-axis moves to the center of the chart area instead of staying near the bottom.
Any ideas why this happens? I prefer not to have to reformat these each time I open the file.
Thanks
Hi brianbredeway,
You can add this small module in the workbook_beforeclose event:
Note: Please modify the code as per your requirementPrivate Sub Workbook_BeforeClose(Cancel As Boolean) ProtectChartFormats End Sub Public Sub ProtectChartFormats() Dim i As Integer, j As Integer With ThisWorkbook For j = 1 To .Sheets.Count For i = 1 To .Sheets(j).ChartObjects.Count .Sheets(j).ChartObjects(i).ProtectFormatting = True Next Next End With End Sub
Last edited by nchavan; 03-29-2010 at 06:47 AM. Reason: For adding a note.
Cheerz,
~Ne@l
*********************************************************************
Save a tree. Please think before you print this post and/or attachments.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks