Has anybody and suggestions on this application error?

G

Guest

Hello

As background, I built an excel workbook that has 4 worksheets. Worksheet 1
has a dynamic chart that will build a custom chart based upon data in
Worksheets 2 to 4.

Anyway, all was working fine until yesterday when, on selecting a certain
chart to show, I get the following error message...

[The instruction at “0x651b$1d3†referenced memory at “0x0000004câ€. The
memory cannot be “readâ€.

Click on OK to terminate the application.
Click on CANCEL to debug the application.]

I have searched the web but not found any satisfactory explanations for this
or how to overcome the problem. I have also created a new replica excel
workbook by copying the data over but the error still occurs.

Once I built my workbook it was working fine. Then I sought to protect the
workbook as read only. Because I need macros to run on the workbook I used
VBA code...

Application.UnProtect UserInterfaceOnly:= True

....to allow the charts to update whilst sheet is read only.

It was after doing this that I noticed the problem. Maybe this is the root
cause of the error.

I'd really appreciate any help on this matter as having devoted an amount of
time to this project and collated lots of data I'd hate to fall at the final
hurdle.

Or to borrow a sport commentators quote, 'I feel like I have spent the past
month tunneling out of Alcatraz only to come up in the yard of San Quentin'

Regards


Alex
 
G

Guest

Hi

I'm not going to run this code on my PC, but how about using
Application.UnProtect UserInterfaceOnly:= False

Not sure this will work, but you need to reverse what you have done here,
and this should be worth a try. Run it from an empty workbook, and then try
to open the affected file, but without running the errant macro.
 
G

Guest

Oh yes, and if this solves your problem, in your macro, use code to unprotect
the worksheet itself, do its thing, and then protect the sheet again.

ActiveSheet.Unprotect
do your thing
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
or something to that effect
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top