Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Problem with pivot table when workbook is protected

Hi,

One of the sheets of a workbook has a pivot table. All works fine till
the workbook is protected. When the workbook is protected and opened:
a message box appears with the following log:

Microsoft Office Excel File Repair Log
Errors were detected in file 'C:\rsp\excel\1testprotection cee.xls'
The following is a list of repairs:
PivotTable report 'PT2' on '[1testprotection cee.xls]Summary' was
discarded due to integrity problems.

The workbook.open event has the Workbook.unprotect code at the
beginning and workbook.protect code at the end. I did this as the
workbook.open event was failing at the following line:
Worksheets("Change log").Visible = False
(I wanted to hide this sheet on opening the workbook)

Thanks in advance for the help.

Regards,
Raj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 150
Default Problem with pivot table when workbook is protected

On Jun 28, 8:02*am, Raj wrote:
Hi,

One of the sheets of a workbook has a pivot table. All works fine till
the workbook is protected. When the workbook is protected and opened:
a message box *appears with the following log:

Microsoft Office Excel File Repair Log
Errors were detected in file 'C:\rsp\excel\1testprotection cee.xls'
The following is a list of repairs:
PivotTable report 'PT2' on '[1testprotection cee.xls]Summary' was
discarded due to integrity problems.

The workbook.open event has the Workbook.unprotect code at the
beginning and workbook.protect code at the end. I did this as the
workbook.open event was failing at the following line:
Worksheets("Change log").Visible = False
(I wanted to hide this sheet on opening the workbook)

Thanks in advance for the help.

Regards,
Raj


Some more information for those who could help:

The worksheets have code in their activate and deactivate events. This
is also true of the worksheet having the pivot table. I am using C
Pearson's code for hiding the sheets in the workbook before close
event and unhiding the sheets in the workbook open event. The workbook
is protected with a password. I have a feeling that the problem is
occurring when the close event is fired. When the sheets are being
hidden, there is something that is corrupting the file. Because on
opening the file next time the "unable to read" and corrupt message
above appears. I tried Application.enableevents = false and
Application.enableevents = true just before and after the hide code
in the workbook close event to see if that helped. Even that did not
help... Any clue on why this could be happenning and any workarounds?

The requirement is this: A workbook should have all its sheets hidden
except one when it is opened without enabling macros. There should be
no way to unhide the worksheets till macros are enabled. When macros
are enabled, the user should be able to access the sheets. This works
wonderfully well with the code at cpearson site. The problem starts
when I try protecting the workbook. The workbook gets corrupted and
the message as above appears.


Please Help.

Thanks in Advance.

Regards,
Raj
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
Refreshing Pivot Table on a protected spreadsheet tab EarlyBirdie Excel Discussion (Misc queries) 1 July 5th 09 07:31 AM
create a pivot table from a protected workbook guz Excel Discussion (Misc queries) 0 October 30th 08 10:34 AM
Refresh pivot table on protected sheet richzip Excel Discussion (Misc queries) 3 January 18th 08 08:21 PM
Pivot Table based on data in protected cells pdberger Excel Programming 1 December 26th 07 10:38 PM
Pivot Table Use When Sheet is Protected ExcelMonkey Excel Discussion (Misc queries) 1 August 19th 05 12:10 AM


All times are GMT +1. The time now is 06:28 AM.

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

About Us

"It's about Microsoft Excel"