Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro for copy objects

Hi guys,

I need to write a macro to copy a chart object to clipboard.

Can you guys please help me with it?

Saurabh

19 Replies
beck_bakytbek
Master
Master

Try this:

Sub ScreenShot

ActiveDocument.ActivateSheet ("YourSheet" like SH12).CopyBitmapToClipboard

end Sub

hope that helps

maiconmello
Creator III
Creator III

I need copy this obj and pasting in the sheet, for this user is modify.

thank you !

beck_bakytbek
Master
Master

Hi Maicon.

can you explain me your Situation, i have some ideas, but i dont't understand your Business case

Beck

maiconmello
Creator III
Creator III

hi beck,

I need create a copy of the object.

why copy the object ?

For the user, is the possibility alter this propriety, with subtotal.

This is propriety is not enable when acess, only when create the new object.

beck_bakytbek
Master
Master

Do you mean  "is not enable when acess": Access Point?

beck_bakytbek
Master
Master

Hi Maicon

in this blog you will find the solution for your Problem: qlikblog.at

if you dont find the solution, let me know, and we wll try together to find the solution.

Beck

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you upload a sample qvw that demonstrates the problem?

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

HirisH_V7
Master
Master

Hi,

Go to -> Tools -> Edit Module ->

Copy Paste this Code:

sub CopyObject

ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard

end sub


Then, Create a button-> Actions-> External->Run Macro -> CopyObject


  • There you should change CH01 as per your requirement to respective object ID.
  • You should also change left down in module settings->current local security and requested module security -> allow system access


By Clicking on the buttton Copy to clipboard done and then open your word document and paste it.


Hope this helps your requirement ,

PFA,

Hirish



HirisH
“Aspire to Inspire before we Expire!”
maiconmello
Creator III
Creator III

Hi Rob, i send you my model for test.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm sorry, I left off part of the code. CreateObjectFromXmlPropertiesFile is a member of Sheetobject, so the code has to be:

ActiveDocument.ActiveSheet.CreateObjectFromXmlPropertiesFile("CH01.xml")

I tested this in QV11 and it works, In QV12, which I see you are using, the macro hangs and I'm not sure why.

-Rob