Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to copy a chart by Macro?

If there is a chart(CH01) in active sheet, I want to copy this chart to another sheet.

4 Replies
sparur
Specialist II
Specialist II

Hi, John.

Try to use function WriteXmlPropertiesFile and CreateObjectFromXmlPropertiesFile.

Examples from API guide:

ActiveDocument.GetSheetObject( "CH01" ).WriteXmlPropertiesFile "C:\MychartProp.xml"
ActiveDocument.ActiveSheet.CreateObjectFromXmlPropertiesFile "C:\MychartProp.xml"


Anonymous
Not applicable
Author

Hi sparur.

Thank you very much. It's work fine.

I would like to know how can I do if I want to copy it from Sheet01 to Sheet02 ?

sparur
Specialist II
Specialist II

try to use function ActivateSheetByID:

ActiveDocument.ActivateSheetByID "SH02"

and then create new object from xml

Anonymous
Not applicable
Author

OK,I will try it.

Thank you!