View Single Post
 
Old 09-10-2023, 09:15 PM
soroush.kalantari soroush.kalantari is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jun 2021
Posts: 124
soroush.kalantari is on a distinguished road
Default Error when assigning a macro to an Excel Chart Sheet

I want to have a macro to assign another macro to a chart that is in an Excel Chart Sheet. To know how to do this, I have recorded a macro. However, recorded macro don’t work when running on a new Chart Sheet and, as the picture attached shows, encounters error at “Selection.OnAction = "test01”. (See the excel attached. the name of the recorded macro is “test02” and the name of the macro I want to assign to chart sheets is “test01".
Can you guide me on this issue?
Recorded macro:
Sub test02()

ActiveChart.ChartArea.Select
Selection.OnAction = "test01"
End Sub
Attached Images
File Type: png error03.PNG (6.5 KB, 13 views)
Attached Files
File Type: xlsm assigningmacrotochartsheet.xlsm (28.2 KB, 5 views)
Reply With Quote