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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

How can I get the current sheet name in a variable ?

I know there is a function called GetActiveSheetId() that returns the current Id, but how about the current name?

Is there any trick to solve it?

Many thanks in advance.

4 Replies
pover
Partner - Master
Partner - Master

In the QV API, look at the ISheetProperties Class. The following example is how to get to the name of the sheet.

set vSheet=ActiveDocument.GetSheetByID("SH03")
set sp=vSheet.GetProperties
set v = ActiveDocument.Variables("Variable1")

v.SetContent sp.Name,true

Regards.

Then to assign it to a variable

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Thanks Karl, but I want to avoid to do it in the macro script.

Is it possible to do it like a variable?

I mean, you can set a variable like v = GetActiveSheetId() and this would return the id of the variable. And I want exactly the same to get the Name of the sheet.

Is that possible?

Many thanks anyway

pover
Partner - Master
Partner - Master

Not that I know of. It would be much easier to do the reverse and put in the sheet name field a variable.

Regards.

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Ok Karl. Many thanks anyway