Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Is there any way to delete Script tab through macro code.
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
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
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.
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
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?
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
Yes you are right but still the members are not working.
For eg:
ConfirmRemoveTab,
UseAjaxUI