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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Delete the tab

Hello,

Is there any way to delete Script tab through macro code.

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Which tab you need to delete it

sub DeleteTabInScript

docprop=Activedocument.GetProperties

ArrayScript = split(docprop.Script,"///$tab ")

dim count

For i=1 to Ubound(ArrayScript)

if(Left(Trim(ArrayScript(i)),Len("Main 2"))="Main 2") then 'Where Main 2 is the tab to delete

         count=i

          exit for

end if

next

docprop.Script = "///$tab "  & ArrayScript(1)

For i=2 to Ubound(ArrayScript)

if(i <> count) then

          docprop.Script = docprop.Script & chr(10)&"///$tab " & ArrayScript(i)

end if

next

Activedocument.SetProperties docprop

end sub

Celambarasan

View solution in original post

6 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Which tab you need to delete it

sub DeleteTabInScript

docprop=Activedocument.GetProperties

ArrayScript = split(docprop.Script,"///$tab ")

dim count

For i=1 to Ubound(ArrayScript)

if(Left(Trim(ArrayScript(i)),Len("Main 2"))="Main 2") then 'Where Main 2 is the tab to delete

         count=i

          exit for

end if

next

docprop.Script = "///$tab "  & ArrayScript(1)

For i=2 to Ubound(ArrayScript)

if(i <> count) then

          docprop.Script = docprop.Script & chr(10)&"///$tab " & ArrayScript(i)

end if

next

Activedocument.SetProperties docprop

end sub

Celambarasan

Not applicable
Author

Celambarasan,

Your really great. But i've one doubt, the few of macro code's which ur using are not existing in API guide. For eg: Split functionality.

If i want to learn macro code perfectly, Where can i get tutorial. Please share your knowledge.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     In API you will get the Qlikview Object access functionalities.For other things you have to look in to the general VB Script functions.

Celambarasan

Not applicable
Author

Ok thanks. But few of Class of API guide codes are not working. Why?

For eg:

IDocumentProperties

IUserPreferences

etc.,

What we need to do to work?

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     you cannot use the classes directly you need to use the members only.

     For example

     GetProperties and SetProperties are comes under IDocumentProperties which has members.

Celambarasan

Not applicable
Author

Yes you are right but still the members are not working.

For eg:

ConfirmRemoveTab,

UseAjaxUI