Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Progress or Status Bar (VBScript)

Anyone come up with a good way to display some useful text to the user WHILE the VBScript is processing?  I tried updating out to a text object, but the object is only updated when the script completes.

Tags (1)
1 Solution

Accepted Solutions
Not applicable

Re: Progress or Status Bar (VBScript)

I was able to figure this out.  I created a text box, and named it "StatusBar."  I then created the below function and called the function whenever I wanted something displayed to the user DURING processing of the VB. 

I found that the "WaitForIdle" command would make sure the text box would refresh such that the user would see the content in the "StatusBar" text box.  I also found that the "WaitForIdle" command is expensive in terms of processing time.  So I also added a parameter in the function "sUpdateScreen" that I could use to tell the function to update the screen or not.  Passing "CLS" to the function clears the text box.

FUNCTION StatusBar(sStatusBar,sUpdateScreen)

  set myObject = ActiveDocument.GetSheetObject("StatusBar")

  set myObjectProp = myObject.GetProperties

  SELECT CASE sStatusBar

  CASE "CLS"

  myobject.SetText ""

  CASE ELSE

  myobject.SetText now & ":  " & sStatusBar & chr(10) & myobject.GetText

  END SELECT

  if sUpdateScreen = True then ActiveDocument.GetApplication.WaitForIdle

END FUNCTION

4 Replies
Siva_Sankar
Honored Contributor

Re: Progress or Status Bar (VBScript)

Carletion,

Find here http://community.qlik.com/thread/32363

Regards.

Siva

Not applicable

Re: Progress or Status Bar (VBScript)

Siva,

Thanks for the suggestion, but that isn't what I was looking for.  I was hoping to find some solution similar to the Excel VBA command Application.StatusBar where I can display actual text to the user as the VBScript is progressing.  The solution you propose is only the equivelant to an hour-glass effect. 

Any other ideas?

Not applicable

Re: Progress or Status Bar (VBScript)

I was able to figure this out.  I created a text box, and named it "StatusBar."  I then created the below function and called the function whenever I wanted something displayed to the user DURING processing of the VB. 

I found that the "WaitForIdle" command would make sure the text box would refresh such that the user would see the content in the "StatusBar" text box.  I also found that the "WaitForIdle" command is expensive in terms of processing time.  So I also added a parameter in the function "sUpdateScreen" that I could use to tell the function to update the screen or not.  Passing "CLS" to the function clears the text box.

FUNCTION StatusBar(sStatusBar,sUpdateScreen)

  set myObject = ActiveDocument.GetSheetObject("StatusBar")

  set myObjectProp = myObject.GetProperties

  SELECT CASE sStatusBar

  CASE "CLS"

  myobject.SetText ""

  CASE ELSE

  myobject.SetText now & ":  " & sStatusBar & chr(10) & myobject.GetText

  END SELECT

  if sUpdateScreen = True then ActiveDocument.GetApplication.WaitForIdle

END FUNCTION

Not applicable

Re: Progress or Status Bar (VBScript)

This sounds to me an interesting question. I don't have much experience in status control, hence I feel so helpless on these kind of question, though I'd ever coped with a C# progressbar control. The solution here is so helpful and insightful to me. I'd like to see more related questions.

Community Browser