Microsoft KB Archive/135502

= Errors Using AccessLinks with Protected Worksheet =

Article ID: 135502

Article Last Modified on 6/11/2007

-

APPLIES TO


 * Microsoft Excel 95 Standard Edition
 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q135502



In the Data menu, you may receive the following error message:

Unexpected error creating Microsoft Access form or report

If you use the Convert To Access command on the Data menu, you may receive the following error message:

Unexpected error converting to Microsoft Access



CAUSE
This behavior occurs when the worksheet that you are using to create an Access Form or Report (or converting to Microsoft Access) is protected. This problem only occurs if you select the Contents or the Objects check box in the Protect Sheet dialog box when you protect the worksheet; that is, if you protect only the scenarios in the worksheet, the error messages described above do not occur when you use the AccessLinks add-in with this worksheet.

This problem occurs because the AccessLinks add-in creates an object and defined names on the worksheet that you use to create a Microsoft Access form, report, or database. For example, when you create a report (using the Access Report command) from your worksheet, a View Access Report button is added to the worksheet so that you can view the report by clicking the button on your worksheet. However, if your worksheet is protected, and the Contents or Objects check box was selected when you protected the worksheet, you receive the error message described above when you create the report, because the button cannot be added to the worksheet.

If the contents of your worksheet is protected when you use the AccessLinks add-in, you receive the error message immediately after you click Access Form, Access Report, or Convert To Access on the Data menu. If the worksheet contents is not protected, but the worksheet objects are protected when you use the AccessLinks add-in, you do not receive an error message until Microsoft Access starts, and a table is created from the data on your worksheet. At this point, the inactive Microsoft Excel title bar begins flashing, and you receive the error message when you click Microsoft Excel to activate the application.



WORKAROUND
To avoid receiving an error message when you use the AccessLinks add-in with your worksheet in Microsoft Excel, unprotect your worksheet before you use the Access command on the Data menu.

You CAN protect your worksheet scenarios without receiving an error message when you use the AccessLinks add-in.



MORE INFORMATION
