Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody,
I am trying to launch a macro (using a button with an action) which needs to copy text from a charts to the clipboard.
I am using this line (Edit Module):
ActiveDocument.GetSheetObject("CH01").CopyTextToClipboard
And it works...... .. . . . .. once ???
If I use the button again it doesn't do anything anymore. After I close the qlikview file and open it again then it works again, also only once.
Does anybody know why this is and what I can do to fix it?
Thanks!
You don't need system access to execute that macro.
It might be as simple as that you haven't specifed the macro sub name in the button properties.
If your macro code reads:
sub CopyText
ActiveDocument.GetSheetObject("CH01").CopyTextToClipboard
end sub
the button properties > Actions > Macro Name should say CopyText
Kind regards,
Staffan
Support Technician, QlikTech
Hi, What are you doing with the content after putting it into Clipborad ? IF you required to Paste it in Excel Sheet then you can try the below :-
Sub Export()
Dim kost
Set XLApp = CreateObject("Excel.Application")
XLApp.Visible = TRUE
Set XLDoc = XLApp.Workbooks.Add
kost = ""
kost = "Sheet1"
ActiveDocument.GetSheetObject("CH01").CopyTextToClipboard 'Copy the charts value
XLDoc.Sheets(kost).Range("A" & 1).Select
XLDoc.Sheets(kost).Paste
ActiveDocument.GetSheetObject("CH02").CopyTextToClipboard 'Copy the charts value
XLDoc.Sheets(kost).Range("H" & 1).Select
XLDoc.Sheets(kost).Paste
End Sub
Thanks Manish,
That is some usefull code!
But I just found out that it isn't the code that is causing the problem. it looks like it is the button.
When I go to the properties of the button >> Actions >> Edit Module (@Run Macro) and I run [ Test ] then it does copy the charts.
But when I save this and use the actuel button in the Qlikview document it doesn't.
I already changed the security settings to:
Requested Module Security ---- > System Access
Current Local Security --- > Allow System Access
But no difference.....
You don't need system access to execute that macro.
It might be as simple as that you haven't specifed the macro sub name in the button properties.
If your macro code reads:
sub CopyText
ActiveDocument.GetSheetObject("CH01").CopyTextToClipboard
end sub
the button properties > Actions > Macro Name should say CopyText
Kind regards,
Staffan
Support Technician, QlikTech
Yes that it! Thanks!