error macro run-time 1004

W

Will

I have recorded a macro that simply selects a chart and
then prints. I did this for several charts in the
worksheet. I then added buttons so the user just has to
click the button to print a particular chart. I closed
this file and opened up today and each button I try has
run time error 1004 also with the words "Activate method
of chart object failed" What's up ??
Thanks for any help..........Will
 
F

Frank Kabel

Will said:
I have recorded a macro that simply selects a chart and
then prints. I did this for several charts in the
worksheet. I then added buttons so the user just has to
click the button to print a particular chart. I closed
this file and opened up today and each button I try has
run time error 1004 also with the words "Activate method
of chart object failed" What's up ??
Thanks for any help..........Will

Hi Will
maybe you can post the relevant part of your code - would be easier to
analyse :)
Seems that there is a relative reference to you chart.

Frank
 
W

Will

Oddly enough I think I may have stumbled on the problem,
maybe. The worksheet I have the buttons on was protected
because I have cells in another part of the sheet I didn't
want anyone to mess with. When I unprotected the sheet,
the buttons worked fine. I guess when a sheet is protected
you can't run macros.........true ??
Thanks again.....Will
 
F

Frank Kabel

Will said:
Oddly enough I think I may have stumbled on the problem,
maybe. The worksheet I have the buttons on was protected
because I have cells in another part of the sheet I didn't
want anyone to mess with. When I unprotected the sheet,
the buttons worked fine. I guess when a sheet is protected
you can't run macros.........true ??
Thanks again.....Will

Hi Will
you can run macros in general but I think they affect you protected
worksheet/chart. You may unprotect the sheet before running the macro
and protecting it again after running the macro. So something like

sub foo()
ActiveSheet.Unprotect
'.... your code here
ActiveSheet.Protect Scenarios:=True, UserInterfaceOnly:=True
end sub

Frank
 
W

Will

Thanks for the help Frank........Will

-----Original Message-----


Hi Will
you can run macros in general but I think they affect you protected
worksheet/chart. You may unprotect the sheet before running the macro
and protecting it again after running the macro. So something like

sub foo()
ActiveSheet.Unprotect
'.... your code here
ActiveSheet.Protect Scenarios:=True, UserInterfaceOnly:=True
end sub

Frank

.
 

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