Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Enable or disable the property "send to Excel" of a pivot table with a macro

I should enable or disable the property "send to Excel" of a pivot table with a macro.

error loading image

Can anyone tell me if it is possible via VB and how to set this property.

Thanks.

5 Replies
Not applicable
Author

It looks like there is a typo in the API Guide, but it can be done on a chart using:

Sub HideXL
set mybox = ActiveDocument.GetSheetObject("CH01")
mbp = mybox.GetProperties
mbp.GraphLayout.Frame.XLIcon = false
mybox.SetProperties mbp
End Sub


I think other objects would use:

Sub HideXL
set mybox = ActiveDocument.GetSheetObject("LB01")
mbp = mybox.GetProperties
mbp.Layout.Frame.XLIcon = false
mybox.SetProperties mbp
End Sub


That disables them, set XLIcon to true to show the icon.

Not applicable
Author

Thanks, it works very well

Anonymous
Not applicable
Author

Hi all, this is my first post (actually it's a question). I tried the solution to hiding excel icons and got it to work. However I want to hide / show ALL excel icons from all objects with a button. Is there a quick way to do this? I don't want to create dozens of buttons or a really long script. Many thanks in Advance.

Not applicable
Author

Hi David,

a simple way is to use a loop on ojects:

function DisableSendToExcel

for i=1 to 3

set mybox = ActiveDocument.GetSheetObject("CH"&i)

mbp = mybox.GetProperties

mbp.GraphLayout.Frame.XLIcon = false

mybox.SetProperties mbp

next

end function 'DisableSendToExcel

... Better would be to automatically assign IDs

Anonymous
Not applicable
Author

I thought it must be something simple. I'll give it a go - many thanks. Really appreciated.