Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Partner
Partner

Module Displays Immediately After Opening File

Hi,

I am trying to clean up my script a little bit, and while doing so I must have removed a line that previously prevented the module from popping up when the file is opened... Below is what displays when I open up my document:

ModuleDisplaysOnFileOpen.PNG

Does anyone know what causes this?

Or if there are any specific lines of code I should be looking for to add back in so that this does not appear when the file is opened (i.e. SUB/END SUB, Call TraceInfo(), TRACE, etc.... I deleted a lot of script so any keywords would be great)?

I've looked in my log file to see if there's anything that might point me in the right direction, but I haven't been able to find anything that sticks out to me yet.

Thanks in advance,

Ben

1 Solution

Accepted Solutions
kingsley101
New Contributor III

Re: Module Displays Immediately After Opening File

Hi Ben.

I haven't gone through your code as I'm not that clued up on vbscript or jscript...

Normally, the module will pop up when a piece of code didn't finish running. So for example if it pops up when you open the qvw, it is likely that the model has an OnOpen trigger and that trigger isn't running successfully. Please check what that trigger is and that will help us analyse the correct section of code.

Many thanks

View solution in original post

4 Replies
kingsley101
New Contributor III

Re: Module Displays Immediately After Opening File

Hi Ben.

I haven't gone through your code as I'm not that clued up on vbscript or jscript...

Normally, the module will pop up when a piece of code didn't finish running. So for example if it pops up when you open the qvw, it is likely that the model has an OnOpen trigger and that trigger isn't running successfully. Please check what that trigger is and that will help us analyse the correct section of code.

Many thanks

View solution in original post

Partner
Partner

Re: Module Displays Immediately After Opening File

Ahh ok I see the trigger... so if I'm understanding this correctly... let's say the module has the following code:

"Sub IslandDefaults()

' Purpose: Changes Island Unit Conversion default value.

  set source = ActiveDocument.Variables("_SysUnitofMeasure")

  IF source.GetContent.String <> "" THEN

    set fld = ActiveDocument.GetField("[Island Shipping Unit Code]")

' removes current selection

    set prop = fld.GetProperties

    fld.SetProperties prop

    fld.Clear

' set Field to valid in Unit of Measure - defined in spreadsheet - BI Parameters

    ActiveDocument.Fields("[Island Shipping Unit Code]").Select source.GetContent.String

    set prop = fld.GetProperties

    fld.SetProperties prop

  END IF

End Sub"

... And let's say I've commented out part of the load script that sets '_SysUnitofMeasure', or the load statement for '[Island Shipping Unit Code]' field... would that be the reason why it isn't running successfully? If so... I can fix it by removing the coding related to those variables/fields in the module correct? (I've barely worked with the module before so I appreciate your patience with me!)

Thanks,

Ben

kingsley101
New Contributor III

Re: Module Displays Immediately After Opening File

Hi Ben.

No problem at all. That's correct. If the parameter hasn't been defined (in this case a variable or field) then the vbscript sub won't be able to continue executing and therefore fails.

Other than that, your code seems correct.

Thanks

Partner
Partner

Re: Module Displays Immediately After Opening File

Thanks that worked!