Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-10-2023, 09:15 PM
soroush.kalantari soroush.kalantari is offline Error when assigning a macro to an Excel Chart Sheet Windows 10 Error when assigning a macro to an Excel Chart Sheet Office 2016
Competent Performer
Error when assigning a macro to an Excel Chart Sheet
 
Join Date: Jun 2021
Posts: 115
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, 11 views)
Attached Files
File Type: xlsm assigningmacrotochartsheet.xlsm (28.2 KB, 3 views)
Reply With Quote
  #2  
Old 09-13-2023, 11:36 AM
BobBridges's Avatar
BobBridges BobBridges is offline Error when assigning a macro to an Excel Chart Sheet Windows 7 64bit Error when assigning a macro to an Excel Chart Sheet Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

My VBE agrees that OnAction is not a property supported by a Chart object. But when I try to record my own macro to see about that part, I realize I don't know how to assign a macro to a chart. I right-clicked on your chart area, but I don't see an option in the list about assigning a macro to it. What method did you use when recording your macro?
Reply With Quote
  #3  
Old 09-15-2023, 02:11 PM
soroush.kalantari soroush.kalantari is offline Error when assigning a macro to an Excel Chart Sheet Windows 10 Error when assigning a macro to an Excel Chart Sheet Office 2016
Competent Performer
Error when assigning a macro to an Excel Chart Sheet
 
Join Date: Jun 2021
Posts: 115
soroush.kalantari is on a distinguished road
Default

Quote:
Originally Posted by BobBridges View Post
My VBE agrees that OnAction is not a property supported by a Chart object. But when I try to record my own macro to see about that part, I realize I don't know how to assign a macro to a chart. I right-clicked on your chart area, but I don't see an option in the list about assigning a macro to it. What method did you use when recording your macro?
Thank you for your reply. As the attached picture shows, I select the select the chart and then right clicked on it.
Attached Images
File Type: png picture01.PNG (96.9 KB, 9 views)
Reply With Quote
  #4  
Old 09-15-2023, 07:50 PM
BobBridges's Avatar
BobBridges BobBridges is offline Error when assigning a macro to an Excel Chart Sheet Windows 7 64bit Error when assigning a macro to an Excel Chart Sheet Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Interesting; that option doesn't appear when I right-click on the area. We must be using different flavors of Excel. Guess I can't help you; sorry.
Reply With Quote
Reply

Tags
chart sheet



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel data sheet size when opening powerpoint chart Sissy PowerPoint 0 08-15-2019 04:35 AM
Error when assigning a macro to an Excel Chart Sheet Excel Macro: Multiple Search and Post in Excel Sheet andxie Excel Programming 10 05-31-2018 05:21 PM
Error when assigning a macro to an Excel Chart Sheet Error in exporting Google Sheet to Excel cmcmeekin Excel 2 08-03-2016 11:32 AM
Error when assigning a macro to an Excel Chart Sheet How To Open an Macro From 2003 Excel in 2013 Excel Spread Sheet? ADubin Excel Programming 3 02-08-2015 04:57 AM
Error when assigning a macro to an Excel Chart Sheet Excel 2010 Chart SetSourceData 1004 error pocerus Excel Programming 4 10-26-2014 08:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft