Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I don't think this can be done, but if anyone has a solution I'll be pleased to see it.
I would like to change the theme of a document programatically. I don't really care whether that would mean setting/checking a variable in the script or doing something just when the document loads, but I would like to be able to change the theme without having to do it manually.
Any ideas?
I found an example to change the Document Theme in the API Guide.
Here is the example:
ActiveDocument.ApplyTheme "A:\Forest.qvt"
That would need to be in a macro, which you could put in the OnLoad or OnActivate of the main sheet or something.
Thanks Ninja, that works - though not quite as expected because of the bugs that exist in the theme wizard, but that's another story. The principle ok though - cheers.
Hi all,
It works at Document level but not at Sheet level, where this method is simply un-recognized by vbscript engine (v9 SR5 ) even if it's present in API.QVW documentation.
DOESN'T WORK
ActiveDocument.Sheets("QSH01").applyTheme "C:\Etr\Cruscotto.qvt"
WORK
ActiveDocument.applyTheme "C:\Etr\Cruscotto.qvt"
Any Idea?
Thanks in advance
Sorry, i forgot to mention that If I manually apply the theme at sheet level, it works perfectly, so it's not a matter of theme.
Thanks in advance,
Fabrizio
I'm also having trouble applying a theme to one sheet. I tried ActiveSheet() and GetSheetById() and neither did anything with ApplyTheme. I can set the theme for the entire document no problem. Maybe a bug?
EDIT: Just tried it in 10 with the same issue. I'd say this is a bug or at the very least ApplyTheme is not implemented for the Sheet object.
Hi NMiller,
I do agree with you , think it's a bug not a missing feature.
Hope QlikTech will fix it, it's not good when you extensively use themes and must force them manually.
The worst side is that themes do not dinamically update "themed" objects when you update the QVT file so this mess is a big, big deal.
Maybe,for tuture releases, an interesting new option could be "LINK TO A THEME" along by the actual "APPLY A THEME".
Thanks for your kind reply, this answered my post.
fabrizioyahoo wrote:
Hi all,
It works at Document level but not at Sheet level, where this method is simply un-recognized by vbscript engine (v9 SR5 ) even if it's present in API.QVW documentation.
DOESN'T WORK
ActiveDocument.Sheets("QSH01").applyTheme "C:\Etr\Cruscotto.qvt"
WORK
ActiveDocument.applyTheme "C:\Etr\Cruscotto.qvt"
Any Idea?
Thanks in advance
<div></div>
Thanks for pointing out this bug. It will be fixed in QV10 SR2.
I say thank you ... You and all the community members are Wellcome!
Happy Qliking,
Fabrizio.